`
luc15luc
  • 浏览: 16307 次
社区版块
存档分类
最新评论

invalid operation for the current cursor position-lwfshr-iteye技术网站

 
阅读更多

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")); 
  
  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics