- // Before that, add rs2XML.jar to your project properties by adding // addLibray // option
private void b2ActionPerformed(java.awt.event.ActionEvent evt) {
int id = 0;
String name = "";
String mobile = "";
String email = "";
String flat = "";
String query="";
Connection con;
try{
String query= "select * from apt"
con=DBconnect.ConnectDB();//it a class the connection properties are defined here
PreparedStatement ps;
ps = con.prepareStatement(query);
ResultSet rs = ps.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
}
}catch(Exception ee){
ee.printStackTrace();
}
}
user7621988