This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
joew weakers
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 33696
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe,
Use "getString()" instead of "getLong()".

Good Luck,
Avi.
 
bill tang
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic