public boolean simpan(){
        boolean adaKesalahan = false;	
	Connection cn = null; 
	
	try{ 
            Class.forName(Koneksi.driver); 
        } catch (Exception ex){ 
            adaKesalahan = true; 
            JOptionPane.showMessageDialog(null,"JDBC Driver tidak ditemukan atau rusak\n"+ex,"Kesalahan",JOptionPane.ERROR_MESSAGE);  
	} 
	
        if (!adaKesalahan){ 
            try { 
                cn = DriverManager.getConnection(Koneksi.database+"?user="+ Koneksi.user+"&password="+Koneksi.password+""); 
            } catch (Exception ex) { 
                adaKesalahan = true;  
                JOptionPane.showMessageDialog(null,"Koneksi ke "+Koneksi.database+" gagal\n"+ex,"Kesalahan",JOptionPane.ERROR_MESSAGE); 
            } 
            
            if (!adaKesalahan){ 
                int jumlahSimpan = 0; 
                String SQLStatemen;
                Statement sta;
                
                try{
                    SQLStatemen = "delete from kwitansi where no_beli='"+no_beli+"'"; 
                    sta = cn.createStatement(); 
                    sta.executeUpdate(SQLStatemen);
                } catch (Exception ex){}
                
                for (int i=0; i < listKwitansi.length; i++){                  
                    try {
                        SQLStatemen = "insert into kwitansi values ('"+ no_beli +"','"+ listKwitansi[i][0] + "','" + listKwitansi[i][1] + "','" + listKwitansi[i][2] + "')"; 
                        sta = cn.createStatement(); 
                        jumlahSimpan += sta.executeUpdate(SQLStatemen);                      
                    } catch (SQLException ex){}
                }
                
                if (jumlahSimpan>0) {
                    adaKesalahan = false;
                }
            }
        } 		
        return !adaKesalahan;
    }