我想知道是否有一种方法可以清除CallableStatement的OUT参数,就像对PreparedStatement的绑定参数有一个clearParameters()方法一样。由于CallableStatement扩展了PreparedStatement,我尝试使用clearParameters()方法,但它没有重置OUT参数。
示例:
CallableStatement statement = conn.prepareCall("call myStoredProcedure (?)");
statement.registerOutParameter("myOutParameterName", Types.VARCHAR);
statement.clearParameters();
statement.execute(); //still working despite clearParameters()
System.out.println(statement.getString("myOutParameterName")); //still working despite clearParameters()