我编写了一个从数据库读取数据的程序,最后一列是布尔值,0 表示假,1 表示真,但我想将该列显示为复选框。我现在将粘贴我的代码:private void update_table(){
String sql = "select dailies.id as 'م', customers.name as' العميل',ddate as' التاريخ' ,cars.name as' السيارة',material.name as' المادة',quantity as'عدد',dailytypes.name as' الوحدة',unitprice as' سعر الوحدة',discount as' الخصم',(unitprice*quantity - discount) as' الإجمالي',notes as' ملاحظات', paid as'تم السداد' from dailies,customers,cars,material,dailytypes where ddate=? and dailies.customer = customers.id and dailies.car = cars.id and dailies.material = material.id and dailies.type = dailytypes.id order by ddate";
try{
pst = conn.prepareStatement(sql);
//JOptionPane.showMessageDialog(null, currentdate());
pst.setString(1, currentdate());
rs = pst.executeQuery();
tbldailies.setModel(DbUtils.resultSetToTableModel(rs));
//tbldailies.addColumn();
}catch (Exception ex){
JOptionPane.showMessageDialog(null, ex);
} finally{
try{
rs.close();
rs1.close();
pst.close();
}
catch(Exception e){
e.printStackTrace();
}
}
}