Greetings all, there is an error "Array required, but java.lang.Object Found" please its support. ..
This coding it :
public void loadData() {
//Menghapus seluruh data
model.getDataVector().removeAllElements();
//Memberitahu data telah kosong
model.fireTableDataChanged();
try {
Connection c = (Connection) KoneksiDatabase.getKoneksi();
Statement s = c.createStatement();
String sql = “select * from mahasiswa”;
ResultSet r = s.executeQuery(sql);
while(r.next()) {
//Lakukan penelusuran baris
Object o = new Object[5];
o[0] = r.getString(“Nim”);
o[1] = r.getString(“Nama”);
o[2] = r.getDate(“Tanggal_Lahir”);
o[3] = r.getString(“Jurusan”);
o[4] = r.getString(“Alamat”);
model.addRow(o);
}
r.close();
s.close();
} catch (SQLException e) {
System.out.println(“Terjadi kesalahan proses Pengambilan Database”);
}
}
Thanks before. ..