现象:使用微软的JDBC for SqlServer sp3却发现不 支持 ResultSet.last(),ResultSet.beforeFirst() 等 方法 ,每次一调用这些 方法 就出现异常,异常信息是:java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported method: Result
现象:使用微软的JDBC for SqlServer sp3却发现不支持ResultSet.last(),ResultSet.beforeFirst() 等方法,每次一调用这些方法就出现异常,异常信息是:java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported method: ResultSet.last
解决:Statement变量要按照如下设置
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
类似的,
CallableStatement cs = conn.prepareCall("{call TESTSP}",ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
其中type_scroll_sensitive是个关键
字段摘要
TYPE_SCROLL_SENSITIVE
该常量指示可滚动但通常受其他的更改影响的 ResultSet
对象的类型。
Copyright © 2019- shangjiatang.cn 版权所有 湘ICP备2022005869号-4
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务