File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes Store Procedure in Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Other Application Frameworks
Reply Bookmark "Store Procedure in Spring" Watch "Store Procedure in Spring" New topic
Author

Store Procedure in Spring

rahul karwal
Ranch Hand

Joined: Oct 26, 2001
Posts: 73
I am calling a store procedure from Spring(extending MappingSqlQuery)
and that procedure has one of the parameters as optional (eg @iD Integer = null).I am using Sybase and my question is how do you pass null from Java knowing that its an Integer? I tried to do this Integer x =null and pass x as teh param but give me exceptions.can anyone pls help me.
thanks
aziz
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
If the DB procedure signature specifies that a parameter is optional and has a default value specified as well, are we required to pass it in when calling fro java?

Did you check java.sql.Types.NULL ?
[ November 30, 2005: Message edited by: Karthik Guru ]
rahul karwal
Ranch Hand

Joined: Oct 26, 2001
Posts: 73
yes we are required to pass in the parameter or spring is complaining.
 
 
subject: Store Procedure in Spring
 
Threads others viewed
Garbage collection-Marcus exam
trouble passing array to stored procedure in spring HELP
REF_CURSOR as IN parameter?
How to pass an Integer Array to a Stored Procedure in mysql?
Error :java.sql.SQLException: Invalid column index
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture