tags:

views:

748

answers:

2

I am writting JAVA programme using JDBC for database conntectivity , I am calling one stored procedure in that which is returning ORACLE REF CURSOR , IS there any way I can handle that without importing ORACLE PACKAGES ?

+1  A: 

I think I tried to do this a while ago and kind of gave up (I guess you could figure out what int value the OracleTypes.REF_CURSOR is and then use that int value, but that's a hack). If you got the patience you could define a record (or object) type and define the the cursor as a cursor with type since that can be cast using table to a value that is selectable like regular tables, ie

select * from table( sp_returning( ? ) )

I did a quick google on ref cursor and jdbc and it looks like it might be an oracle extension which would explain why there is no standard way to access the data.

jwiklund
A: 

Doing

select * from table( sp_returning( ? ) )

is slower than returning a ref cursor.

I can use a ref cursor in combination with C#, why can't you do it with Java? I'm sure there are plenty examples.

tuinstoel