java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid operation for the current cursor position 即当前游标为空
出错了,代码如下:DBtest.jsp
<body>数据库查询:
<%
Connection con = null;
con = DriverManager.getConnection("proxool.Develop");
if(con!=null){
Statement st= con.createStatement();
ResultSet rst=st.executeQuery("select * from user_info");
out.println(rst.getString("name"));
}
else
out.println("fail");
}catch(Exception e)
{e.printStackTrace();
%>
</body>
需要在程序中加入:rst.next();移动到有数据的地方才能取数据。
修改后的代码如下:
ResultSet rst=st.executeQuery("select * from user_info");
rst.next();
out.println(rst.getString("name"));
分享到:
相关推荐
invalid pointer operation(解决方案).md
invalid operation(解决方案).md
Invalid Operation Mode(亲测可用).md
InvalidSignature-The signature is invalid(解决方案).md
InvalidArgument-The argument is invalid(解决方案).md
Invalid Path Operation(解决方案).md
invalid IO operation(解决方案).md
invalid struct operation(解决方案).md
invalid channel operation(解决方案).md
invalid slice operation(解决方案).md
invalid interface operation(解决方案).md
invalid method operation(解决方案).md
invalid map operation(解决方案).md
invalid function operation(解决方案).md
The value for key CFBundleShortVersionString [1.2] in the Info.plist file must contain a higher version than that of the previously approved version [1.15] 明明1.2的版本号要大于1.15,怎么还会出现错误...
Invalid Ring Operation(亲测可用).md
invalid type for member name (解决方案).md
TypeError: ‘required’ is an invalid argument for positionals 的解决方法 当我在使用argparse模块时,遇到了如下错误: import argparse parser = argparse.ArgumentParser(description = 'debug_example') ...