Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

User defined types

 
Dmitry Shekhter
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In my java code, i'm calling a stored procedure which has an output parameter of a user defined type, that parameter contains more than one value. How can i retrieve that parameter? I've tried getArray, getStruct, etc.. nothing seems to work.
Thanks in advance.
Dmitry
 
Brett Spell
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dmitry,
You need to use getObject() and cast the value that's returned as a Struct:

------------------
Brett Spell
Author, Professional Java Programming
 
Dmitry Shekhter
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Brett, but how do i register the out parameter? Could you provide a code sample for that?
Thanks again.
Dmitry
 
Brett Spell
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dimitry,
Here's a modified version of the sample code that includes registration of the parameter:

------------------
Brett Spell
Author, Professional Java Programming
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic