如何使用MySQL在两个日期之间查询并在jtable上显示所选日期
java.util.Date val1=jDateChooser1.getDate();
java.util.Date val2=jDateChooser2.getDate();
try{
String sql="select * from Umar where Date between '"+val1+"' and '"+val2+"' ";
pst=conn.prepareStatement(sql);
rs=pst.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
}