java.sql.SQLException: Before start of result set
2013-08-20 12:00
671 查看
解决方法:使用rs.getString();前一定要加上rs.next();
原因:ResultSet对象代表SQL语句执行的结果集,维护指向其当前数据行的光标。每调用一次next()方法,光标向下移动一行。最初它位于第一行之前,因此第一次调用next()应把光标置于第一行上,使它成为当前行。随着每次调用next()将导致光标向下移动一行。在ResultSe对象及其t父辈Statement对象关闭之前,光标一直保持有效。
原因:ResultSet对象代表SQL语句执行的结果集,维护指向其当前数据行的光标。每调用一次next()方法,光标向下移动一行。最初它位于第一行之前,因此第一次调用next()应把光标置于第一行上,使它成为当前行。随着每次调用next()将导致光标向下移动一行。在ResultSe对象及其t父辈Statement对象关闭之前,光标一直保持有效。
相关文章推荐
- java.sql.SQLException:Before start of result set解决方法
- JDBC:java.sql.SQLException: Before start of result set怎么办
- java.sql.SQLException: Before start of result set
- Java与mysql数据库编程中遇见“Before start of result set at com.mysql.jdbc.SQLError.createSQLException” 的解决办法
- java.sql.SQLException: Before start of result set解决方法
- 解决 java.sql.SQLException: Before start of result set
- java.sql.SQLException: Before start of result set
- java.sql.SQLException: Before start of result set解决方法
- java.sql.SQLException: Before start of result set
- java.sql.SQLException: Before start of result set(转)
- java.sql.SQLException: Before start of result set异常及处理办法
- Java与mysql数据库编程中遇见“Before start of result set at com.mysql.jdbc.SQLError.createSQLException” 的解决办法
- java.sql.SQLException: Before start of result set
- java从MySQL表中取出数据时报错:java.sql.SQLException: Before start of result set
- Java与mysql数据库编程中遇见“Before start of result set at com.mysql.jdbc.SQLError.createSQLException” 的解决办法
- java.sql.SQLException: Before start of result set
- sql问题:java.sql.SQLException:Before start of result set
- java.sql.SQLException: Before start of result set异常及处理办法
- java.sql.SQLException: Before start of result set
- java.sql.SQLException: Before start of result set解决方法