When I press the button it always duplicates the existing records on the jTable. How can I show just one data at a time?
void showAll(){
try{
rs=stmt.executeQuery("SELECT * FROM ATTENDANCE");
while (rs.next()){
String a1 = rs.getString("NAME");
String b1 = rs.getString("COURSE");
String c1 = rs.getString("STUDENTNO");
String d1 = rs.getString("DATE");
DB1.addRow(new Object[]{a1,b1,c1,d1});
}
}catch(Exception e){
System.out.println(e);
}
}