public boolean hapus(String kode_buku){
        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 = (Connection) DriverManager.getConnection(Koneksi.database+"?user="+Koneksi.user+"&password="+Koneksi.password+"");
            } catch (Exception ex) {
                adaKesalahan = true;
                JOptionPane.showMessageDialog(null,"Koneksi ke database"+Koneksi.database+" gagal\n"+ex,"Kesalahan",JOptionPane.ERROR_MESSAGE);
            }
            if (!adaKesalahan){
                int jumlahHapus;
                try {
                    String SQLStatemen = "delete from buku where kode_buku='"+kode_buku+"'";
                    Statement sta = (Statement) cn.createStatement();
                    jumlahHapus = sta.executeUpdate(SQLStatemen);
                    if (jumlahHapus>0){
                        sta.close();
                        JOptionPane.showMessageDialog(null,"Data buku dengan kode_buku "+kode_buku+" sudah dihapus","Informasi",JOptionPane.INFORMATION_MESSAGE);
                    } else {
                        sta.close();
                        JOptionPane.showMessageDialog(null,"Data buku dengan kode_buku "+kode_buku+" tidak ditemukan","Informasi",JOptionPane.INFORMATION_MESSAGE);
                        adaKesalahan = true;
                    }
                } catch (Exception ex){
                    adaKesalahan = true;
                    JOptionPane.showMessageDialog(null,"Tidak dapat membuka tabel buku\n"+ex,"Kesalahan",JOptionPane.ERROR_MESSAGE);
                }
            }
        }
        return !adaKesalahan;
    }