Error "java.sql.SQLException: Conversion to Timestamp Failed" When Using Scrollable Resultset

(Doc ID 1080941.1)

Last updated on AUGUST 04, 2016

Applies to:

Oracle JDeveloper - Version: 10.1.3.0.4 to 10.1.3.5.0 - Release: to JDeveloper 10g
Information in this document applies to any platform.

Symptoms

When using 
conn.prepareStatement(query, ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);

on JDeveloper 10g on a plain Java/JDBC program (using the JDBC drivers bundled with JDeveloper) with a table column with timestamp with timezone data type, when we access the column of our query's result set with:

System.out.println(resultSet.getTimestamp("myTwTZcolumn"));

we get the following exception

java.sql.SQLException: Conversion to Timestamp failed
10/03/30 07:40:53 at oracle.sql.Datum.timestampValue(Datum.java:283)
10/03/30 07:40:53 at oracle.jdbc.driver.ScrollableResultSet.getTimestamp(ScrollableResultSet.java:672)
10/03/30 07:40:53 at oracle.jdbc.driver.OracleResultSet.getTimestamp(OracleResultSet.java:1715)


Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms