aspose file tools*
The moose likes Other Application Frameworks and the fly likes Exception in executing SimpleJdbcCall for fetching resultset/REF cursor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Exception in executing SimpleJdbcCall for fetching resultset/REF cursor" Watch "Exception in executing SimpleJdbcCall for fetching resultset/REF cursor" New topic
Author

Exception in executing SimpleJdbcCall for fetching resultset/REF cursor

Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
Hi,

I get null pointer exceptions while executing a SimpleJdbcCall(Spring 2.5.4) based implementation of calling stored procedures, posted the same query in sppring forums but haven't got any help yet so I am posting it here again.

Hi

I was trying a bit modified usage of this class for a procedure that accepts one input and returns all rows of the table in question. Some what similar to an example given for the same in spring reference the only difference being that the procedure i call has an input as well.

The stored procedure being called in my code is as follows


I used the SimpleJdbcCall as follows


I got the following exception when in run the class



Anadi Mishra.
Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
I changed the procedure definition as follows and then retried(am not that good with stored procedures )



I modified the EventDaiImpl class to add print statements, the previous exception did not occur as expected but now i get Null pointer exception


the debug mode shows that the resultMap has only Null Values
an extract is as follows


Please point out whats done wrong here, something in the class or the procedure may be?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Um, don't you have to tell it all the parameters, not just the first one. It needs to also be told the out parameters. I think.

Don't you need more useOutParameterNames?

.useInParameterNames("IN_TITLE").returningResultSet("events",ParameterizedBeanPropertyRowMapper.newInstance(Event.class));

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
Hi,

The SimpleJdbcCall class does not require that we explicitly tell all the parameters the code is like staright from the spring reference for version 2.5.5 the only difference is thatthey gave a nexample of a procedure with no input param and returning a result set/REF Cursor.

We have many procedures in our system which take a parameter or two and return a result set, so i was trying this modification to check how it works with this class
Anadi Misra
Ranch Hand

Joined: Jun 03, 2008
Posts: 69
Hi,

This more strange than I had imagined, i did some small modifications in the code to figure out why is it going wrong.



I am totally confused now on what is happening here, i was expecting a sort of Map with ID as the key and the domain objects (Event) and values. What is happening is that all the out params in the procedure are keys and I end up getting the last row of the result only in this map.
[ August 29, 2008: Message edited by: Anadi Misra ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception in executing SimpleJdbcCall for fetching resultset/REF cursor