• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fail to convert to internal representation

 
Shamik
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I'm having an issue regarding reading of reference cursor values in java. When I'm trying to read the values in resultset from the ref cursor,I'm getting "Fail to convert to internal representation error" . I'm calling a procedure which is returning a reference cursor.Here's the code :

cStt = conn.prepareCall("{call Labview_Ph4_Report_Qry.get_contact_info_new(?,?)}") ;
cStt.registerOutParameter(1,OracleTypes.CURSOR) ;
cStt.registerOutParameter(2,OracleTypes.VARCHAR) ;
cStt.execute() ;
if("OK".equals(cStt.getString(2)) == false)
{
return lcReturnValue ;
}
// rSet = (ResultSet)cStt.getObject(1) ;
rSet = ((OracleCallableStatement)cStt).getCursor(1);
if(rSet != null)
{
while(rSet.next())
{
Logwriter.write(rSet.getString(1)+", "+rSet.getString(2));
}
}

When I'm trying to print the values from resultset within the loop, the error is coming up.

Any pointers on this will be higly appreciated.

Thnx,
Shamik
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Mr Kool",

Glad that you're here with us on the good ol' JavaRanch and I reckon that you'll find this a helpful and useful site, but we do got us a few rules that y'all got to play by. One of these is that proper ID is required before you can belly on up to the bar. Please take a gander at the JavaRanch Naming Policy and adjust your display name to match it.

The particulars is that your display name must be a first and a last name separated by a space character, and must not be obviously pulling our legs!

Thank ya kindly!
bear
Forum Bartender
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
following line is commented in your code

rSet = (ResultSet)cStt.getObject(1) ;

did you try with this line,
I will always prefer to get cursor in this line

however I am very sure by curent way of getting curso.

by the way what error are you getting ?

is there any stack trace ???
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34850
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Shamik",
Your display name still needs to be changed. It needs to be two names: a first name and a last name.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic