解决 ResultSet may only be accessed in a forward direction 错误
来源:互联网 发布:喜马拉雅录音软件下载 编辑:程序博客网 时间:2024/05/23 16:54
ResultSet may only be accessed in a forward direction.
这个问题我是在插入数据后返回当前自动增量的主键值时遇到的,
SQL2000数据库驱动为jtds
解决办法:
更改获取数据库连接代码
- PreparedStatement pst = null;
- // 加载数据库驱动
- Class.forName(DRIVER);
- // 获得数据库连接
- con = DriverManager.getConnection(URL, LOGINNAME,LOGINPASSWORD);
- pst = con.prepareStatement(sqlStr); //此处更改为pst=con.prepareStatment(sqlStr,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE)
- return pst;
更改之后就不会再出现返回增量的错误了
- 解决 ResultSet may only be accessed in a forward direction 错误
- ResultSet may only be accessed in a forward direction
- ResultSet may only be accessed in a forward direction
- ResultSet may only be accessed in a forward direction 问题解决
- ResultSet may only be accessed in a forward direction
- ResultSet may only be accessed in a forward direction
- java.sql.SQLException: ResultSet may only be accessed in a forward direction.报错
- ResultSet may only be accessed in a forward direction Hibernate4异常解决方案
- SQL server 读取某表行数以及报错ResultSet may only be accessed in a forward direction
- A Static Method Should Be Accessed In A Static Way
- Spark Q&A : Only one SparkContext may be running in this JVM
- Only one SparkContext may be running in this JVM
- codeblocks中Error:new types may not be defined in a return type错误
- new types may not be defined in a return type错误
- Qt 错误"new types may not be defined in a return type" error
- Recursion all file direction in a direction
- Propert 'c' cannot be found in forward class object 'CALayer *错误解决
- Java Warning:A Static Method Should Be Accessed In A Static Wa
- The Future According to ASP+
- Beginner with c# 2
- 在ASP中调用存储过程的几种方法
- 爱君
- Beginner with c# 6
- 解决 ResultSet may only be accessed in a forward direction 错误
- SOA面向服务的架构
- T—SQL编程
- [原创] Questioning C# (二)
- IE下的脚本调试器的安装
- 关于c#中的消息处理函数和vc中的消息处理函数区别
- MS SQL Server中的CONVERT日期格式化大全
- 好的方法
- VS.NET使用小经验 (转载)