I've wasted a large part of this week getting nowhere trying to invoke a stored procedure that takes an array of Longs. I wouldn't have thought it ought to be too difficult but having trawled the web I am still no closer. I begin to suspect that this doesn't work without apalling hacks.
Above is a cut down version of one of the many code variants I have tried.Code:class Xxx extends StoredProcedure { Xxx(JdbcTemplate) { super(template, schema.package.procedureName) declareParameter(new SqlParameter("arg name", TYPES.ARRAY, "LONG_ARRAY") } // where LONG_ARRAY is defined in the schema Map execute(Long[] data) { Map inputs = new HashMap() inputs.put("arg name", new AbstractSqlTypeValue(Connection c, int type, String typeName) { ArrayDescriptor ad = new ArrayDescriptor(typeName, c); return new ARRAY(ad, c, data) Map outputs = execute(inputs) }
Could someone kindly point out what I am doing wrong, or confirm that it is just not a good idea to invoke Stored Procedures via Spring.
Thanks.


Reply With Quote