Alkali
Alkali

Reputation: 57

How to catch the exception of the execute method while using Spring jdbcTemplate

I use the Spring JDBCTemplate to call a stored procedure ,like this

Map receive10PrmtBill = (Map) getJdbcTemplate().execute(sql, new CallableStatementCallback() {

        @Override
        public Object doInCallableStatement(CallableStatement cs) throws SQLException,
                DataAccessException {
            cs.setString(1, Constants.ADD_PROC_TYPE);
            Map<String,PrmtBillInfoDatagram> tempMap = new HashMap();

            cs.execute();

but the execute method return false and didn't throw any exception ,so I don't know what's wrong with my program , how to catch the Exception? Any help?

This is the proc

create proc sp_xx ( @userid int)    
    as   
    begin   
        select personid, personname from person where personid = @userid  

        select teamid, teamname from team   
    end   

Upvotes: 0

Views: 1639

Answers (1)

Piotr Gwiazda
Piotr Gwiazda

Reputation: 12222

Try setting "IGNORE_DONE_IN_PROC" property to "true". See at: http://javabob64.wordpress.com/2011/04/12/sybase-and-the-jdbc-driver/

Upvotes: 1

Related Questions