jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes REFCURSOR in getCursor CallableStatement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "REFCURSOR in getCursor CallableStatement" Watch "REFCURSOR in getCursor CallableStatement" New topic
Author

REFCURSOR in getCursor CallableStatement

Geeta Rajgor
Greenhorn

Joined: Jun 15, 2001
Posts: 2
Hello,
I was calling a stored package procedure which was returning REFCursor (i am using oracle 8i as backend) through jdbc
and
was importing the Oracle JDBC drivers which support bind variables of type REFCURSOR.(classes from the oracle.jdbc.driver package)
Used the getCursor method of the CallableStatement to convert a REFCURSOR value returned by a PL/SQL block into a ResultSet.
Casting the corresponding CallableStatement to oracle.jdbc.driver.OracleCallableStatement to use the getCursor method.
The problem is this works absolutely fine if i connect as the owner of the package procedure.
but if i create a public syonym for the same package and grant execute on package to other user.
And now if i connect as this execute privilege granted user through jdbc and run the same program it gives me SQLException ora-09542 table or view does not exit.
I am just unable to understand how do i proceed in this case, as no way i can have the package procedure being created in the same user doesn't sound implementable in live environment.
I am using jdk1.3.
Please help me. I hope i have given required info to get an answer.
Thanks.
Geeta
Geeta Rajgor
Greenhorn

Joined: Jun 15, 2001
Posts: 2
Somehow, i got the answer of the question that i put, all those who must have gone through this question.
The answer is very simple. It is a stupid bug in oracle 8.1.6 driver which is fixed in 8.1.7 driver. Use oracle 8.1.7 driver to achieve the same.
 
wood burning stoves
 
subject: REFCURSOR in getCursor CallableStatement
 
Similar Threads
java.lang.ClassCastException when invoking jdbc stored procedure call
Can I execute Oracle procedures through satement
getCursor - where can you find info on this method.
Problem using Callable Statement
Calling DB2 stored procedures