No data found
Statement sq=con.createStatement();ResultSet r=sq.executeQuery("SELECT * FROM stu "+
" WHERE 卡号='"+jComboBox2.getSelectedItem().toString()+"'" );
while(r.next()){
if(r.getDouble("余额")<0){
JOptionPane.showMessageDialog(this,
"您已欠费"+"-"+r.getDouble("余额")+"元,请付账后再下机!","提示",JOptionPane.WARNING_MESSAGE);
}
else{}
我运行上面的代码时出现下面的错误
java.sql.SQLException: No data found
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7138)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataDouble(JdbcOdbc.java:3657)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataDouble(JdbcOdbcResultSet.java:5575)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDouble(JdbcOdbcResultSet.java:738)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDouble(JdbcOdbcResultSet.java:756)
我的余额的类型是数字型的 我找不到错误 请帮帮我