aspose file tools*
The moose likes JDBC and the fly likes Is it possible to get the parameter names in a stored procedure call ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Is it possible to get the parameter names in a stored procedure call ?" Watch "Is it possible to get the parameter names in a stored procedure call ?" New topic
Author

Is it possible to get the parameter names in a stored procedure call ?

salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 928

We are developing a database front end application with limited functionality as a web based application.
We want to give the user the flexibility to allow to execute stored procedures.

Now, As I understand, they can be called like this:

Quoted from http://docs.oracle.com/javase/tutorial/jdbc/basics/storedprocedures.html :
What I am interested to know is is there any way I come to know information about parameters to be passed. For example, in the above code, the RAISE_PRICE requires 3 parameters
2 incoming 1 outgoing with types String, Numeric, Numeric


I tried something like:


whats interesting is that the parameterMetaData.getParameterCount() shows 0.
if I change statement to:


The parameterMetaData.getParameterCount() shows 2

Is there any way for me to come to know the Parameter information given that i know the procedure name ? (Am using Oracle at the moment, but this may change)


My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

I don't have any experience with that, but according to the Connection documentation, the getProcedureColumns method should provide this information.
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 928

Martin Vajsar wrote:I don't have any experience with that, but according to the Connection documentation, the getProcedureColumns method should provide this information.


Found this out the Hard way ... The catalog/schema/procedure names are all Case sensitive !!!

Works like a miracle !!!
Thanks mate.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it possible to get the parameter names in a stored procedure call ?