jdbc 如何调用 sql server 的带输出cursor参数的存储过程?
CallableStatement call =
m_conn.prepareCall("{? = call VipLogin(?,?,?,?,?,?,?,?)}",
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
call.registerOutParameter(1, Types.NUMERIC);
BigDecimal nPosID = new BigDecimal(szPosID);
BigDecimal nOperID = new BigDecimal(szOperID);
BigDecimal nOperPwd = new BigDecimal(szOperPwd);
BigDecimal nCardPwd = new BigDecimal(szCardPwd);
call.setBigDecimal(2, nPosID);
call.setBigDecimal(3, nOperID);
call.setBigDecimal(4, nOperPwd);
call.setString(5, szCardID);
call.setBigDecimal(6, nCardPwd);
call.registerOutParameter(7, Types.REF);
call.registerOutParameter(8, Types.INTEGER);
call.registerOutParameter(9, Types.DATE);
call.execute();
存储过程如下:
CREATE PROCEDURE VipCenter_VipLogin
@szPosID VARCHAR(21),
@szOperID VARCHAR(21),
@szOperPwd VARCHAR(21),
@szCardID VARCHAR(21),
@szCardPwd VARCHAR(21),
@retResultSet CURSOR VARYING output,--返回交易结果集
@nCardType int output,--返回卡类型
@stopDate datetime output--返回卡的到期时间
在执行到call.registerOutParameter(7, Types.REF);时就提示:
[Microsoft][SQLServer 2000 Driver for JDBC]The specified SQL type is not supported by this driver.
难道jdbc不支持sql server 的cursor,那我如何才能在sql server实现cursor output呢????