Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return a hashtable from a java STP

Status
Not open for further replies.

g046678

MIS
Feb 14, 2001
10
US
Any idea on how to return a hashtable or vector from a stored procedure.

Regards.


Dan Pamintuan
 
Can you specify to where you need to return it? I mean thaT calling program should be capable to handle it. As you operate by terms hashtable and vector, the calling program is expected to be on Java, so I see no problems to pass hashtable or vector between 2 Java classes. Though if you meant some kind of collection, Oracle supports a number of different kinds: INDEX BY tables, VARRAYS and NESTED TABLES. You may also consider REF CURSOR, that is not a collection, but rather a handler to some cursor opened on server.

Regards, Dima
 
Passing hashtables between two java pgms usually is not a problem. The problem is when you define a java STP. You have to define an oracle package header. In that header, you have to map java types to oracle types, when you define the INPUT and OUTPUT parms of that STP. So far, I cannot figure out how to map a hashtable or any java object to a oracle type. Thanks for your response. I think this may not be do-able.


Dan Pamintuan
 
There is no strict analogue of Hashtable in Oracle prior to 9i where Associative arrays were introduced. Thus your java procedure should convert that hashtable to something more understandable by Oracle, e.g. some collection type.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top