• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Ranch Hand
Posts: 48
  • 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
 
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • 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 ]
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe,
Use "getString()" instead of "getLong()".

Good Luck,
Avi.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Every plan is a little cooler if you have a blimp. And a tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic