aspose file tools*
The moose likes JDBC 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
Bookmark "Fail to convert to internal representation" Watch "Fail to convert to internal representation" New topic
Author

Fail to convert to internal representation

Shamik
Greenhorn

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)
{
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

Joined: Jan 10, 2002
Posts: 61790
    
  67

"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


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

Joined: Aug 13, 2004
Posts: 1081

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
Marshal

Joined: May 26, 2003
Posts: 31112
    
165

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


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
 
subject: Fail to convert to internal representation