错误原因:
如API中所述
API:
A table of data representing a database result set, which is usually generated by executing a statement that queries the database. A ResultSet object maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The next method moves the cursor to the next row。
就是说游标初始化的位置在首行之前。
解决方法:
在使用rs前要调用rs.next()方法
转载于:https://www.cnblogs.com/xfgnongmin/p/10741937.html
最后
以上就是单纯中心最近收集整理的关于java.sql.SQLException: Before start of result set的全部内容,更多相关java.sql.SQLException:内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复