0
當我從JDateChooser
中選擇退貨簿日期並單擊輸入按鈕時。退回日期不顯示在JTable
中。從字符串SQL中選擇JDatechooser
private void jButton19ActionPerformed(java.awt.event.ActionEvent evt) {
try
{
((JTextField)jDateChooser7.getDateEditor().getUiComponent()).getText();
String sql="select * from borrowed_book_record where return_date='"+jDateChooser7.getDateFormatString()+"'";
pst=conn.prepareStatement(sql);
rs=pst.executeQuery();
jTable4.setModel(DbUtils.resultSetToTableModel(rs));
jTable4.setVisible(true);
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,""+e,"Error",JOptionPane.ERROR_MESSAGE);
}
}
你可以分享'DBUtils'的代碼嗎? – Mureinik