您好,欢迎访问一九零五行业门户网

关于JDBC不支持ResultSet.last()等方法的解决

现象:使用微软的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 对象的类型。
其它类似信息

推荐信息