当我执行搜索查询时,我收到错误“java.sql.SQLException:空结果集上的非法操作”。我想从我的数据库中获取日期到 jDateChoser 上。这是我试过的,请帮帮我!提前致谢!
try {
Statement s = DB2.kavish().createStatement();
ResultSet rs = s.executeQuery("SELECT * FROM Invoice WHERE Invoice_No='"+jTextField28.getText()+"'");
while (rs.next());
jTextField29.setText(rs.getString(2));
jTextField30.setText(rs.getString(3));
jTextField31.setText(rs.getString(4));
jTextField32.setText(rs.getString(5));
jTextField33.setText(rs.getString(6));
jTextField34.setText(rs.getString(7));
jTextField35.setText(rs.getString(8));
jDateChooser1.setDate(rs.getDate(9));
} catch (Exception e) {
e.printStackTrace();
}