参数号“X”不是OUT参数

时间:2013-10-08 05:53:29

标签: java mysql stored-procedures jdbc

访问数据库时出现以下错误,

 SQL Error: 0, SQLState: S1009
 Parameter number 3 is not an OUT parameter

请参阅下面的代码

CallableStatement callableStatement = 
connection.prepareCall("{call ECommerce_GENAUTO(?,?,?,?)}");  
callableStatement.setString(1, orgId);
callableStatement.setString(2, tempCode);

callableStatement.registerOutParameter(3, Types.VARCHAR);
callableStatement.registerOutParameter(4, Types.INTEGER);               

callableStatement.execute();
setAutoGenrtdCode(callableStatement.getString(3));
setAutoGenrtdStatus(callableStatement.getInt(4));

0 个答案:

没有答案