File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes java.sql.SQLException: Fail to convert to internal representation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.sql.SQLException: Fail to convert to internal representation" Watch "java.sql.SQLException: Fail to convert to internal representation" New topic
Author

java.sql.SQLException: Fail to convert to internal representation

joew weakers
Ranch Hand

Joined: Aug 21, 2003
Posts: 48
Hi there. I am trying to execute a simple sql select query using an Oracle JDBC driver but keep encountering an error when I try to access a long value from the OracleResultSet generated. My select statement requests two
int values and one long value from one simple table. The error I get is as follows:

java.sql.SQLException: Fail to convert to internal representation
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)at oracle.jdbc.driver.OracleStatement.getLongValue(OracleStatement.java:4367)
at oracle.jdbc.driver.OracleResultSetImpl.getLong(OracleResultSetImpl.java:529)

My code looks as follows:



Can anybody see the problem here. Thansk a lot, joe
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

Joe,
Can you show the select statement and schema? Also try using rs.getString(3) to make sure you can retrieve the data unformatted.

This isn't the problem, but it's good to use ResultSet instead of OracleResultSet. It makes your code more portable.
[ May 23, 2005: Message edited by: Jeanne Boyarsky ]

[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
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1121

Joe,
Use "getString()" instead of "getLong()".

Good Luck,
Avi.
bill tang
Greenhorn

Joined: May 20, 2005
Posts: 1
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.sql.SQLException: Fail to convert to internal representation
 
Similar Threads
Error in Oracle LONG mapping
quaick question
Fail to convert to internal representation
processing resultset
java.sql.sqlexception data size bigger than max size for this type