Re: Bug? report : PreparedStatement.setObject(java.util.Date) don't work

Поиск
Список
Период
Сортировка
Искать
От
Oliver Jowett
Тема
Re: Bug? report : PreparedStatement.setObject(java.util.Date) don't work
Дата
Msg-id
473579D8.3060600@opencloud.com
Ответ на
Список
Дерево обсуждения
Bug? report : PreparedStatement.setObject(java.util.Date) don't work "雨森郷太郎" <gotaroamenomori@gmail.com>
Re: Bug? report : PreparedStatement.setObject(java.util.Date) don't work dmp <danap@ttc-cmc.net>
Re: Bug? report : PreparedStatement.setObject(java.util.Date) don't work Oliver Jowett <oliver@opencloud.com>
Re: Bug? report : PreparedStatement.setObject(java.util.Date) don't work "雨森郷太郎" <gotaroamenomori@gmail.com>
Re: Bug? report : PreparedStatement.setObject(java.util.Date) don't work Oliver Jowett <oliver@opencloud.com>
Re: Bug? report : PreparedStatement.setObject(java.util.Date) don't work "雨森郷太郎" <gotaroamenomori@gmail.com>
雨森郷太郎 wrote:

> However, Is there reason to refrain from supporting java.util.Date ?

Despite the name, java.util.Date actually contains both date and time 
information, and mapping it to SQL's DATE would silently lose data. 
That's why java.sql.Date exists in the first place: it's a deliberately 
limited subclass that explicitly only carries date information.

We could map java.util.Date to TIMESTAMP, I suppose, but I think that'll 
cause even more confusion since there's also java.sql.Timestamp (that 
gives nanosecond precision vs. java.util.Date's millisecond precision). 
Most of the time, using java.util.Date with JDBC means you've got an 
application bug, and I don't think silently covering it up is a great idea.

-O
В списке pgsql-jdbc по дате отправления
От: 雨森郷太郎
Дата:
От: 雨森郷太郎
Дата:
FAQ