Re: Timestamp Question - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Timestamp Question
Date
Msg-id 40F1E038.20609@opencloud.com
Whole thread Raw
In response to Re: Timestamp Question  ("Dario V. Fassi" <software@sistemat.com.ar>)
List pgsql-jdbc
Dario V. Fassi wrote:

> You are seeing it:
>
>  > test=> select '2004-07-10 12:59:59.123'::timestamp(6);
>  >        timestamp        -------------------------
>  > 2004-07-10 12:59:59.123
>
> I suggest that is cross DBs (eg.  DB2 / PgSql etc) ,  the above
> situation cause troubles.

Sounds like it's not a JDBC problem though -- perhaps you should take it
up on pgsql-general or pgsql-sql?

> ** From a Jdbc client can see rows like:
>     2004-07-10 12:59:59.123
>
> in plase of:
>
>     2004-07-10 12:59:59.12300
> or
>     2004-07-10 12:59:59.00123

If you're using JDBC, you should be using ResultSet.getTimestamp(), not
interpreting the strings directly. Do you have a testcase that uses
getTimestamp() and sees an incorrect value?

-O

pgsql-jdbc by date:

Previous
From: "Dario V. Fassi"
Date:
Subject: Re: Timestamp Question
Next
From: Kris Jurka
Date:
Subject: Re: JDBC Connection