private void ProsesCIH(){
        int jarak=0;
        String str="";
        int numrow = 0, numrow2 = 0;

        Koneksi conn = new Koneksi();
        String query = "SELECT f_asal_h,f_tujuan_h FROM hasil ORDER BY f_asal_h ASC";
        String query2 = "SELECT DISTINCT f_asal FROM data WHERE f_asal NOT IN (SELECT f_asal_h FROM hasil ORDER BY f_asal_h ASC)";              
        String query3 = "SELECT f_jmljarak,f_asal_s,f_sisipan,f_tujuan_s FROM sisipan WHERE f_jmljarak = (SELECT MIN(f_jmljarak) FROM sisipan)";

        ResultSet q1 = null,q2 = null,q3 = null,q4 = null,q5 = null;

        try {
            //Proses mengambil sisipan
            q2 = conn.getStatement().executeQuery(query2);
            if (!q2.next()) {
                jarak = 0;
                str = "";

                //Proses dua kota
                q1 = conn.getStatement().executeQuery(query);
                while (q1.next()) {
                    jarak = jarak + C(q1.getInt("f_asal_h"), q1.getInt("f_tujuan_h"));
                    str=q1.getInt("f_asal_h")+" ~~> "+q1.getInt("f_tujuan_h")+" = ";
                    jTextArea1.append(str+jarak+"\n");
                }
                q1.close();
            } else {                
                do {                    
                    numrow=q2.getRow();//jumlah baris
                } while (q2.next());                                                

                int[] data = new int[numrow];
                int loop=0;

                try{
                    q2 = conn.getStatement().executeQuery(query2);
                    while (q2.next()){
                        data[loop]=q2.getInt("f_asal");                        
                        loop++;                        
                    }
                }catch (SQLException e){}

                q1 = conn.getStatement().executeQuery(query);
                while (q1.next()) {
                    for (int l=0;l<numrow;l++){
                        //input ke tabel sisipan
                        as = q1.getInt("f_asal_h");
                        si = data[l];
                        tu = q1.getInt("f_tujuan_h");

                        Cij=C(as, tu); Cik=C(as, si); Ckj=C(si, tu);
                        if (Cij==0){ Cij=C(tu, as); }
                        if (Cik==0){ Cik=C(si, as); }
                        if (Ckj==0){ Ckj=C(tu, si); }
                        jmljarak=Math.abs(Cik+Ckj-Cij);
                        InsertSisipan(as, si, tu, jmljarak);
                        jTextArea1.append(as+" ~~> "+si+" ~~> "+tu+" = "+jmljarak+" \n");
                    }                    
                }
                jTextArea1.append("=============================\n");
                q3 = conn.getStatement().executeQuery(query3);//Mencari jarak minimum dari tabel sisipan
                if (q3.next()) {
                    assip=q3.getInt("f_asal_s");
                    sisip=q3.getInt("f_sisipan");
                    tusip=q3.getInt("f_tujuan_s");
                    jTextArea1.append("Jalur dengan jarak terpendek:\n");
                    jTextArea1.append(assip+" ~~> "+sisip+" ~~> "+tusip+" = "+q3.getInt("f_jmljarak")+"\n");                    
                    jTextArea1.append("=============================\n");                                        

                    q4 = conn.getStatement().executeQuery("SELECT * FROM hasil");
                    do {
                        numrow=q4.getRow();
                    } while (q4.next());                    
                    
                    int[] asal = new int[numrow], nmr = new int[numrow];
                    loop=0;

                    try{
                        q4 = conn.getStatement().executeQuery("SELECT * FROM hasil ORDER BY f_nomor DESC");
                        while (q4.next()){
                            asal[loop]=q4.getInt("f_asal_h");
                            nmr[loop]=q4.getInt("f_nomor");
                            loop++;
                        }
                    } catch (SQLException e){}
                    
                    q5 = conn.getStatement().executeQuery("SELECT f_nomor FROM hasil WHERE f_nomor > '1'");
                    do {
                        numrow2=q5.getRow();                        
                    } while (q5.next());

                    int[] nomer = new int[numrow2],assal = new int[numrow2];
                    loop=0;                    
                    try {
                        q5 = conn.getStatement().executeQuery("SELECT f_asal_h,f_nomor FROM hasil WHERE f_nomor > '1' ORDER BY f_nomor DESC");
                        while (q5.next()){
                            assal[loop]=q5.getInt("f_asal_h");
                            nomer[loop]=q5.getInt("f_nomor");
                            loop++;
                        }                        
                    } catch (SQLException e){}

                    for (int i=0;i<numrow;i++){                        
                        //MULAI INPUTAN KEDALAM TABEL HASIL
                        if (assip==asal[i]){
                            if (assip==1){
                                conn.getStatement().executeUpdate("UPDATE hasil SET f_tujuan_h='"+sisip+"' WHERE f_asal_h=1");
                                for (int j=0;j<numrow2;j++){
                                    conn.getStatement().executeUpdate("UPDATE hasil SET f_nomor=(f_nomor+1) WHERE f_asal_h = '"+assal[j]+"' ");
                                }
                                this.InsertHasil(sisip, tusip, 2);                                
                            } else {
                                conn.getStatement().executeUpdate("UPDATE hasil SET f_tujuan_h='"+sisip+"' WHERE f_asal_h='"+assip+"'");                                
                                conn.getStatement().executeUpdate("UPDATE hasil SET f_nomor=(f_nomor+2) WHERE f_nomor > '"+nmr[i]+"'");                                
                                this.InsertHasil(sisip, tusip, (nmr[i]+1));                                
                            }
                        }
                    }

                    ResultSet qhasil = conn.getStatement().executeQuery("SELECT * FROM hasil ORDER BY f_nomor ASC");
                    jTextArea1.append("Jalur yang dilalui : \n");
                    while (qhasil.next()){
                        jTextArea1.append(qhasil.getInt("f_asal_h")+" ~~> "+qhasil.getInt("f_tujuan_h")+", ");                        
                    }
                    jTextArea1.append("\n\n");
                }
            }
        } catch (SQLException ex){
            JOptionPane.showMessageDialog(null,""+ex.getMessage());
        }        
    }