Re: using Date and setObject()

Поиск
Список
Период
Сортировка
Искать
От
Joe Shevland
Тема
Re: using Date and setObject()
Дата
Msg-id
HEECIHEEJDBMCCGMGIOBMECOCHAA.jshevland@j-elite.com
Ответ на
Список
Дерево обсуждения
using Date and setObject() Leandro Rodrigo Saad Cruz <leandro@ibnetwork.com.br>
Re: using Date and setObject() Thomas O'Dowd <tom@nooper.com>
Re: using Date and setObject() "Joe Shevland" <jshevland@j-elite.com>
The big difference is of course, is that the java.sql.Date is "A thin wrapper around a millisecond value that allows JDBC to identify this as a SQL DATE (JDK1.3.1 doco)" - it subclasses java.util.Date so certainly holds time ;)

In relation before that, java.util.Date holds a specific instance in time - without timezones coming into play - in reality the amount of seconds since Unix birth or 1970 or whatever it is. I'm not sure about the JDBC driver and backend interaction, but I'd be using a GregorianCalendar or Calendar instance instead, which is more suitable for manipulating dates and times. I'm not sure if the setObject() method caters for this though.

Cheers,
Joe

> Never tried it but what about using setObject(java.sql.Date)
>                                                    ^^^
> 
> The big difference between the objects of course is that the 
> java.sql.Date only holds the date part and not the time part.
> 
> Tom.
> 
> On Wed, Apr 17, 2002 at 02:53:43PM -0300, Leandro Rodrigo Saad Cruz wrote:
> > Hi all, I'm working an a persistence layer API above JDBC
> > that uses setObject() in prepare statements. the problem is : 
> > I get a ClassCastException when using setObject(java.util.Date).
> > Can I use setObject(java.util.Date) or I **must** use
> > setDate(java.util.Date) ??
> > 
> > -- 
> > Leandro Rodrigo Saad Cruz
> > IT - Inter Business Tecnologia e Servicos (IB)
> > http://www.ibnetwork.com.br

В списке pgsql-jdbc по дате отправления
От: Joe Shevland
Дата:
Сообщение: Re: BLOB performance test FYI
От: Joe Shevland
Дата:
Сообщение: Re: BLOB performance test FYI
FAQ