File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Fail to convert to internal representation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Fail to convert to internal representation" Watch "Fail to convert to internal representation" New topic

Fail to convert to internal representation


Joined: Jan 14, 2005
Posts: 1
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)
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.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63838

"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!
Forum Bartender

[Asking smart questions] [About Bear] [Books by Bear]
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1082

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 ???

Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

Your display name still needs to be changed. It needs to be two names: a first name and a last name.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Fail to convert to internal representation
It's not a secret anymore!