Announcement Announcement Module
Collapse
No announcement yet.
jdbcTemplate.query for Stored procedures Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • jdbcTemplate.query for Stored procedures

    I am trying to use JdbcTemplate to call a stored procedure can it be done?

    My store procedure is:
    PROCEDURE get_next_event (
    p_uuid IN VARCHAR2,
    curvar_out OUT tcdn_eventdata_defs.curvar_type
    )

    And I have being trying with the following bit of code with out success:
    try
    {
    List customers = jdbcTemplate.query("call TCDN_PKG.get_next_event(?,?)", new Object[] { uuid }, new CustomerMapper());

    Great if anybody could give me a pointer.

  • #2
    You have to use not query, but one of the execute methods:
    • Object execute(String callString, CallableStatementCallback action) throws DataAccessException;
    • Object execute(CallableStatementCreator csc, CallableStatementCallback action)
    • Map call(CallableStatementCreator csc, List declaredParameters) throws DataAccessException;


    See Javadoc for further detaile
    Originally posted by [email protected] View Post
    I am trying to use JdbcTemplate to call a stored procedure can it be done?

    My store procedure is:
    PROCEDURE get_next_event (
    p_uuid IN VARCHAR2,
    curvar_out OUT tcdn_eventdata_defs.curvar_type
    )

    And I have being trying with the following bit of code with out success:
    try
    {
    List customers = jdbcTemplate.query("call TCDN_PKG.get_next_event(?,?)", new Object[] { uuid }, new CustomerMapper());

    Great if anybody could give me a pointer.

    Comment

    Working...
    X