result set type is TYPE_FORWARD_ONLY_token odbc
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/15 19:02:20
result set type is TYPE_FORWARD_ONLY_token odbc
Java调用存储过程的时候,总是报result set type is TYPE_FORWARD_ONLY 的错误 驱动是通过odbc数据源来实现的
而改用jdbc直连的话这个问题就没有了
前提是结果集的类型我已经设置成 result.TYPE_SCROLL_INSENSITIVE的类型了,
还有就是 sql server2000 的 sp4补丁我已经打过了,但是有的java项目直连sqlserver2000 的时候还是会报 error esblishing socket 错误
Java调用存储过程的时候,总是报result set type is TYPE_FORWARD_ONLY 的错误 驱动是通过odbc数据源来实现的
而改用jdbc直连的话这个问题就没有了
前提是结果集的类型我已经设置成 result.TYPE_SCROLL_INSENSITIVE的类型了,
还有就是 sql server2000 的 sp4补丁我已经打过了,但是有的java项目直连sqlserver2000 的时候还是会报 error esblishing socket 错误
有没有类似
rs.last()
int i = rs1.getRow();
的代码?
1这是你定义指针类型的时候只定义成了,向前移动的类型.
2设定结果集回滚.
connect=dataSource.getConnection();
Statement stmt=connect.createStatement();
ResultSet rs=stmt.executeQuery(strSql);
rs.last();
这样写之后会报rs.last()有错,后来看到last()方法:
Throws:
SQLException - if a database access error occurs or the result set type is TYPE_FORWARD_ONLY
后来查明原因果然是因为the result set type is TYPE_FORWARD_ONLY,查明的具体过程是:System.out.println(rs.getType());看到打印出来的结果是1003,后到JDK的src里面查到int TYPE_FORWARD_ONLY = 1003;这句话,说明the result set type is TYPE_FORWARD_ONLY.
那么解决办法就是要把the result set type 不要设成 TYPE_FORWARD_ONLY,后来在网上查到解决办法是:
connect=dataSource.getConnection();
Statement stmt=connect.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
//Statement stmt=connect.createStatement(1004,1007);
ResultSet rs=stmt.executeQuery(strSql);
rs.last();
rs.last()
int i = rs1.getRow();
的代码?
1这是你定义指针类型的时候只定义成了,向前移动的类型.
2设定结果集回滚.
connect=dataSource.getConnection();
Statement stmt=connect.createStatement();
ResultSet rs=stmt.executeQuery(strSql);
rs.last();
这样写之后会报rs.last()有错,后来看到last()方法:
Throws:
SQLException - if a database access error occurs or the result set type is TYPE_FORWARD_ONLY
后来查明原因果然是因为the result set type is TYPE_FORWARD_ONLY,查明的具体过程是:System.out.println(rs.getType());看到打印出来的结果是1003,后到JDK的src里面查到int TYPE_FORWARD_ONLY = 1003;这句话,说明the result set type is TYPE_FORWARD_ONLY.
那么解决办法就是要把the result set type 不要设成 TYPE_FORWARD_ONLY,后来在网上查到解决办法是:
connect=dataSource.getConnection();
Statement stmt=connect.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
//Statement stmt=connect.createStatement(1004,1007);
ResultSet rs=stmt.executeQuery(strSql);
rs.last();
result set type is TYPE_FORWARD_ONLY_token odbc
There is no result type defined for type 'input' mapped with
There is no result type defined for type 'json' mapped with
This new type of TV set is very expensive.(改为感叹句)
can you tell me how to set the words type,yours is so cool 翻
Struts2中result-type的作用是?
People set to get the result of football match
java.sql.SQLException: Illegal operation on empty result set
what type of email do you want to set up?
填空~The result is ___the___
result
The result of the study indicated that it was the type of fa