File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes how to register OUT param to RECORD type for STORED PROCEDURE??? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "how to register OUT param to RECORD type for STORED PROCEDURE???" Watch "how to register OUT param to RECORD type for STORED PROCEDURE???" New topic
Author

how to register OUT param to RECORD type for STORED PROCEDURE???

java freak
Greenhorn

Joined: Mar 09, 2005
Posts: 7
hi
i have a SP like this


CREATE OR REPLACE PACKAGE P1 AS

TYPE g_con_ref_cursor is REF CURSOR ;

TYPE g_con_error IS RECORD
(
error_code NUMBER,
error_desc varchar2(2000)
);

PROCEDURE PROC_CURSOR
(i_str_userid IN VARCHAR2,
o_cur_ref_cur OUT g_con_ref_cursor,
o_rec_error OUT g_con_error,
o_num_status OUT NUMBER);

END;



and now i am trying to call this SP using my java program
i am able to register the out put params for 2nd and 4 th variable

my doubt is how i can register the output param for 3rd (g_con_error) which is of record type

and how i can get result from this ???

my java program is like this

Connection connection = DatabaseHelper.prepareConnection();
CallableStatement proc = connection.prepareCall("{ call P1.PROC_CURSOR(?, ?, ?, ?) }");
proc.setString(1,"jn26557");
proc.registerOutParameter(2,oracle.jdbc.driver.OracleTypes.CURSOR);
proc.registerOutParameter(3,???,???); //HOW TO SET THIS ???
proc.registerOutParameter(4,oracle.jdbc.driver.OracleTypes.NUMERIC);
proc.execute();


plz help me in this
i have no idea how to do it

any help would be appreciated


Thanks in advance
Jaya Prakash Nalajala
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1114

Jaya,
If you haven't done so already, I suggest visiting the following Web page:

http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html

It has links to sample code and documentation.

As far as I know, what you are trying to do is not supported by Oracle's JDBC driver.

Instead of a record, you may be able to define some object type -- and that (I think) is supported. Again, the sample code available (from the above Web page) illustrates how to do this (if I remember correctly).

Good Luck,
Avi.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to register OUT param to RECORD type for STORED PROCEDURE???
 
Similar Threads
registerOutParameter Problem when the type is ARRAY
problem in regestering OUT param of type OBJECT for ORACLE using JDBC
Oracle custom object from java
Returning Cursor from Stored Procedure
Registering IN OUT parameter