存储过程 急啊!!!
调用查询的存储过程:
cstmt = conn.prepareCall(sql, ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
存储过程:
CREATE PROCEDURE departmentList AS
begin
select * from Department
select * from Position
end
GO
不加:ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY这个就会出错
这是怎么回事,大侠帮忙!!!
还有一个存储过程能返回多个记录集怎么弄,请指教!!
错误:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC](Internal Error) Message not found.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseImplStaticCursorResultSet.getCachedRow(Unknown Source)
at com.microsoft.jdbc.base.BaseImplStaticCursorResultSet.positionCursor(Unknown Source)
at com.microsoft.jdbc.base.BaseImplStaticCursorResultSet.postSetupInitialize(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet. <init> (Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonGetNextResultSet(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
at com.lycSoft.wlms.dataHandle.LoginHandle.departementList(LoginHandle.java:40)
at com.lycSoft.wlms.dataHandle.LoginHandle.main(LoginHandle.java:63)
------解决方案--------------------up
------解决方案--------------------同问 帮顶~
------解决方案--------------------ResultSet.TYPE_SCROLL_SENSITIVE 该常量指示可滚动但通常不受其他的更改影响的 ResultSet 对象的类型。
默认的 ResultSet 对象不可更新,仅有一个向前移动的指针。因此,只能迭代它一次,并且只能按从第一行到最后一行的顺序进行。ResultSet.TYPE_SCROLL_SENSITIVE 可以生成可滚动的 ResultSet 对象。
------解决方案--------------------用存储过程返回游标可以解决。。。