public Object[][] bacaDaftar(){
        boolean adaKesalahan = false;
        Connection cn = null;
        Object[][] daftarPembeli = new Object[0][0];
        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"+Koneksi.database+" gagal\n"+ex,"Kesalahan",JOptionPane.ERROR_MESSAGE);
            }
            if (!adaKesalahan){
                String SQLStatemen;
                Statement sta;
                ResultSet rset;
                try {
                    SQLStatemen = "select kode_buku,judul_buku from buku";
                    sta = (Statement) cn.createStatement();
                    rset = sta.executeQuery(SQLStatemen);
                    rset.next();
                    rset.last();
                    daftarPembeli = new Object[rset.getRow()][2];
                    if (rset.getRow()>0){
                        rset.first();
                        int i=0;
                        do {
                            daftarPembeli[i] = new
                                    Object[]{rset.getString("kode_buku"), rset.getString("judul_buku")
                            };
                            i++;
                        } while (rset.next());
                    }
                    sta.close();
                    rset.close();
                } catch (Exception ex){
                    JOptionPane.showMessageDialog(null,"Tidak dapat membuka tabel buku\n"+ex,"Kesalahan",JOptionPane.ERROR_MESSAGE);
                }
            }
        }
        return daftarPembeli;
    }