jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes Stored Procedure Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Stored Procedure Problem" Watch "Stored Procedure Problem" New topic

Stored Procedure Problem

Nee Kat
Ranch Hand

Joined: Jan 27, 2004
Posts: 37
I am calling a stored procedure in an oracle database.
It is executing properly but I am getting a problem in getting back the data.

Here is what I have:

CallableStatement cstmt = conn.prepareCall("{? = call device_search.qipep(?)}");

//When it reaches here an ORA-00900: invalid SQL statement is thrown.

ResultSet rs = (ResultSet)cstmt.getObject(1);

I think this problem could because of datatype mismatch.
Is there any other way of retrieving data from stored procedure.

Please help
Damanjit Kaur
Ranch Hand

Joined: Oct 18, 2004
Posts: 346
You need to use other getObject(String parameterName, Map map) , providing map value to map from sql type Cursor to java type ResultSet.

Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1082


What is signature of your stored procedure, As I remember for calling Stored Procdure I used to crate CallableStatement like this

CallableStatement cstmt = conn.prepareCall("call device_search.qipep(?,?)");


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
I agree. Here's the link: http://aspose.com/file-tools
subject: Stored Procedure Problem
It's not a secret anymore!