1.数据库中是否有名为SORT的字段? 2.从rs中取出字段对应值时,必须按照顺序,
例如:select id,name from daylight
name = rs.getString("name");
id = rs.getString("id");
就有可能会报错,必须按照顺序取
id = rs.getString("id");
name = rs.getString("name"); 3.建议还是按照序号取
rs.getString(1);
或者你在查询时调整rs中的字段顺序
select name,id from daylight
例如:select id,name from daylight
name = rs.getString("name");
id = rs.getString("id");
就有可能会报错,必须按照顺序取
id = rs.getString("id");
name = rs.getString("name"); 3.建议还是按照序号取
rs.getString(1);
或者你在查询时调整rs中的字段顺序
select name,id from daylight
SQL错误:[Microsoft][SQLServer JDBC Driver]Invalid operation for the current cursor position.
rs.next();将游标移到第一条纪录!
nextpublic boolean next()
throws SQLExceptionMoves the cursor down one row from its current position. A ResultSet cursor is initially positioned before the first row; the first call to the method next makes the first row the current row; the second call makes the second row the current row, and so on. If an input stream is open for the current row, a call to the method next will implicitly close it. A ResultSet object's warning chain is cleared when a new row is read.
快来领分吧
送200分给rinehart(rinehart)
哥们,我到哪里领啊?
^^