I want to populate my jtable with columns from different table in mysql database but it only displays the column names and not the data or information under those columns. i hope this code helps u undertand what i mean. thanks
private void Update_table(){
try{
String sql = "select Date_Acquired 'Date Acquired',Serial_Number 'Serial Number',Description 'Description',Cost_Of_Acquisition 'Cost Of Acquisition',Monthly_Depreciation 'Monthly Depreciation',Accumulated_Depreciation 'Accumulated Depreciation',Net_Book_Value 'Net Book Value',Branch_Area 'Branch Area',Depts_name 'Department Name',User 'User',Status 'Status' from items,branches,department_tbl,net_book_value,asset_update";
pst = conn.prepareStatement(sql);
rs = pst.executeQuery();
dep_report.setModel(DbUtils.resultSetToTableModel(rs));
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}finally{
try{
rs.close();
pst.close();
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
}
}