invalid operation for the current cursor position-lwfshr-iteye技术网站
2011年03月14日
java.sql.SQLException:[Microsoft][SQLServer2000Dri verforJDBC]Invalidoperationforthecurrentcursorposit ion 即当前游标为空
出错了,代码如下:DBtest.jsp
数据库查询:
需要在程序中加入:rst.next();移动到有数据的地方才能取数据。
修改后的代码如下:
ResultSet rst=st.executeQuery("select * from user_info");
rst.next();
out.println(rst.getString("name"));
2011年03月14日
java.sql.SQLException:[Microsoft][SQLServer2000Dri verforJDBC]Invalidoperationforthecurrentcursorposit ion 即当前游标为空
出错了,代码如下:DBtest.jsp
数据库查询:
需要在程序中加入:rst.next();移动到有数据的地方才能取数据。
修改后的代码如下:
ResultSet rst=st.executeQuery("select * from user_info");
rst.next();
out.println(rst.getString("name"));