I have created one jTable. I want to display the data into table from two different tables i.e. table employee and table intime. I have used two resultsets for this, but it is showing last resultset’s value into jTable.
My code is
public void showDailyReport()
{
try
{
Connect c=new Connect();//connection to database
con=(Connection) c.getConnection();
st1=con.prepareStatement("select employee_id,employee_name from tbl_employee");
rs1=st1.executeQuery();
st2=con.prepareStatement("select intime from tbl_intime");
rs2=st2.executeQuery();
table_daily.setModel(DbUtils.resultSetToTableModel(rs1));
table_daily.setModel(DbUtils.resultSetToTableModel(rs2));
}
catch(Exception e)
{
System.out.println(e);
}
}
Please help me to recode this.
Because you are overriding it
If you want to append add data from second result set to model instead of overriding