I've created a subclass of StoredProcedure:
Code:
private static class MyProc extends StoredProcedure { public MyProc(JdbcTemplate t) { super(t, "proc_name"); declareParameter(new SqlParameter("inparam", OracleTypes.VARCHAR)); declareParameter(new SqlOutParameter("outparam", OracleTypes.DECIMAL)); compile(); } public int execProc(String inValue) { int myInt = -1; Map params = new HashMap(); params.put("inparam", inValue); Map outParams = execute(params); if (outParams.size()>0) { myInt = Integer.parseInt(outParams.get("outparam").toString()); } return myInt; } }
25-Jun-2008 13:44:41 org.springframework.jdbc.core.JdbcTemplate extractReturnedResults
INFO: Added default SqlReturnUpdateCount parameter named #update-count-xxxx
where xxxx is an increasing int. This line is generated at the 'execute' statement and repeats until I shutdown tomcat. The stored procedure does not seem to have executed (or has rolled back).
The documentation for running stored procedures with out parameters doesn't seem to go much beyond the api.
Could some point out the obvious newbie error I'm making??
Cheers,
B
Leave a comment: