Unexpected value in Time object

Поиск
Список
Период
Сортировка
От John Pile
Тема Unexpected value in Time object
Дата
Msg-id 88482ea50810240043g54a5cd74n93ae5d6fc60adb2e@mail.gmail.com
обсуждение исходный текст
Ответы Re: Unexpected value in Time object  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
I had a unit test fail for an ORM I'm writing.  I'm creating an object, persisting it in PostgreSQL 8.3 Windows using the postgresql-8.3-603.jdbc3.jar file retrieved from http://repo1.maven.org/maven2/postgresql/postgresql/8.3-603.jdbc3/, retrieving it back and comparing it to the original.
 
I created a java.sql.Time object with an inner "fastTime" value of 1, storing it in a "time with time zone" field using a PreparedStatement insert.  When I retrieve it, also via PreparedStatement, I notice that the "fastTime" value is not the value 1 that I expected, but 86400001 instead.  Although the toString() output looks the same for these two values, the check originalObject.equals(retrievedObject) returns false.
 
The JavaDoc for the java.sql.Time object states, 'The date components should be set to the "zero epoch" value of January 1, 1970 and should not be accessed.', which suggests that the driver's returned value is out of compliance.
 
Database ENCODING = 'WIN1252';  jdk1.6.0_06.  Feel free to contact me for any additional details.
 
John Pile
Sacramento, CA

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Connection hanging on INSERT apparently due to large batch size and 4 CPU cores
Следующее
От: John
Дата:
Сообщение: Re: Connection hanging on INSERT apparently due to large batch size and 4 CPU cores