Thread: JDBC problem on Postgresql 7 beta 5

JDBC problem on Postgresql 7 beta 5

From
"Jack Zhu"
Date:
Hi,

PostgreSQL 7 Beta 5 on Red hat Linux 6.0
JDBC 6.5-1.1 driver, Java 1.1.7B, download JDBC driver from
http://www.retep.org.uk/postgres/

We have a a table which has a column col_a with 'timestamp' data type. When
insert time value to this column, we use format which is 'MM/DD/YYYY
HH24:MI:SS' (such as '05/01/2000 13:20:02'). Insertion is OK.

But when we try to read this column, the output is '05/01/2000
13:20:02.20-04', which is not what we need. We don't need the '.20-04' part
of the output, that is nano second and time zone part, otherwise the output
cannot work with JDBC driver.

Is there any ways make our app work without returning the 'nano and time
zone' part or make JDBC understand the 'timestamp' full output format? Thnx!

Error msg we got from running our app:
"
TAMP = 2000-04-03 00:00:00.0
GETTIME = 954734400000
DATE = Mon Apr 03 00:00:00 EDT 2000
Bad Timestamp Format at 0 in 2000-04-03 12:12:12.12-04
        at postgresql.jdbc1.ResultSet.getTimestamp(ResultSet.java:445)
        at
com.netcom.netforensics.dbaccess.SQLObjectAccess.getProperty(SQLObjectAccess
.java:709)
"


Jack