Hi,
I have a sybase stored proc that can return an indeterminate number of result sets while it is working, finally returning a status. I want to ignore those result sets silently.
If I just dont add a SqlReturnResultSet parameter to my StoredProcedure object, I get warnings in the log file (ResultSet returned from stored procedure but a corresponding SqlReturnResultSet parameter was not declared).
What I did was to subclass the JdbcTemplate:
Question: will this break anything? From what I can tell no, but I'd like to be sure...Code:class MyProc extends StoredProcedure { public static final String SQL = "my_proc"; public MyProc () { setJdbcTemplate(new JdbcTemplate() { /** * overridden to silently ignore any returned result sets */ protected Map extractReturnedResultSets(CallableStatement cs, List parameters, int updateCount) throws SQLException { logger.debug ("ignoring result sets"); return Collections.EMPTY_MAP; } }); setDataSource(dataSource); setFunction(true); setSql(SQL); ...


Reply With Quote