Spring's Stored Procedure - results coming back from procedure always empty

后端 未结 2 1574
遥遥无期
遥遥无期 2020-12-14 11:14

I am using Spring\'s JdbcTemplate and StoredProcedure classes. I am having trouble getting the stored procedure class to work for me.

I have a stored procedure on a

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-14 11:16

    The problem is simple if you don't pass a RowMapper while declaring the outparam which is a CURSOR. Spring is going to return {} I.e empty cursor.

     declareParameter(new SqlOutParameter("output", OracleTypes.CURSOR)); - returns empty {}
     declareParameter(new SqlOutParameter("output", OracleTypes.CURSOR, new ApplicationMapper()); - returns result
    

    Where ApplicationMapper is my custom mapper which implements RowMapper.

提交回复
热议问题