I've no idea how to get this to work, have spent hours looking around to no avail.
I'm trying to call a Oracle stored procedure with an optional IN cursor parameter, with little to no success...
Params:
Setter:Code:<bean id="myReader" parent="baseReader" p:procedureName="myProcedure"> <property name="parameters"> <list> <bean class="org.springframework.jdbc.core.SqlParameter"> <constructor-arg index="0"> <util:constant static-field="java.sql.Types.VARCHAR"/> </constructor-arg> </bean> <bean class="org.springframework.jdbc.core.SqlParameter"> <constructor-arg index="0"> <util:constant static-field="oracle.jdbc.OracleTypes.CURSOR"/> </constructor-arg> </bean> <bean class="org.springframework.jdbc.core.SqlOutParameter"> <constructor-arg index="0"> <util:constant static-field="oracle.jdbc.OracleTypes.CURSOR"/> </constructor-arg> </bean> </list>
and this results inCode:public void setValues(PreparedStatement ps) throws SQLException { CallableStatement cs = (CallableStatement) ps; //constant cs.setString(1, "001"); //null cursor cs.setNull(2, OracleTypes.CURSOR); //result cursor cs.registerOutParameter(3, OracleTypes.CURSOR); }
Anyone know how this is done properly?Code:Caused by: java.sql.SQLException: Unsupported feature: sqlType=-10 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146) at oracle.jdbc.driver.OraclePreparedStatement.setNullCritical(OraclePreparedStatement.java:4399) at oracle.jdbc.driver.OraclePreparedStatement.setNullInternal(OraclePreparedStatement.java:4161) at oracle.jdbc.driver.OracleCallableStatement.setNull(OracleCallableStatement.java:4472) at org.apache.commons.dbcp.DelegatingPreparedStatement.setNull(DelegatingPreparedStatement.java:105) at my.package.MyParameterSetter.setValues(MyParameterSetter.java:xyz)


Reply With Quote