Re: [INTERFACES] JDBC date problem

Поиск
Список
Период
Сортировка
От Peter T Mount
Тема Re: [INTERFACES] JDBC date problem
Дата
Msg-id Pine.LNX.3.96.981019181225.31130h-100000@maidast.retep.org.uk
обсуждение исходный текст
Ответ на Re: [INTERFACES] JDBC date problem  (Aleksey Demakov <avd@gcom.ru>)
Список pgsql-interfaces
On 19 Oct 1998, Aleksey Demakov wrote:

> Peter T Mount <peter@retep.org.uk> writes:
> >
> > > That is, if the column to contain the row creation date is of type
> > > DATETIME, just use now() instead of a ? and a setDate.
> > >
> > > INSERT INTO my_table
> > >   (creation, other_field1, other_field2, other_field3)
> > > VALUES
> > >   ('now', ?, ?, ?);
> > >
> > > Personally, I do this by defining the creation column as a NOT NULL and
> > > giving it a default (There's a bit of a trick here, because you have to use
> > > a function, or 'now' will be interpreted as the time of the creation of the
> > > table, so I define an SQL function which returns 'now'::DATETIME). This
> > > enables me to use a statement like
> > >
> > > INSERT INTO my_table
> > >   (other_field1, other_field2, other_field3)
> > > VALUES
> > >   (?,?,?);
> > >
> > > And not bother myself about the creation dates (which are automatic).
> >
> > This is a valid point, and for his case, I'd agree with you.
>
> Indeed, in my case this is much better solution. Many thanks to Herouth.
>
> > The Date problem is going to be with us as long as people are still using
> > pre 1.1.6 JDK's.
>
> Not quite. Also as long as people are using post 1.1.6 JDK's with the
> 6.3.2 driver.

One thing with the 6.4 driver, is that it's backward compatible with
6.3.2. All of the differences between the two have been either
implementing new features, or bug fixes.

The Date problem is the only incompatible change.

> > I did think of making the driver sence if the bug is present, and then to
> > account for it, but decided against it, on the grounds of performance.
>
> As for me it's ok.
>
> --
> Aleksey Demakov
> avd@gcom.ru
>

--
       Peter T Mount peter@retep.org.uk
      Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf


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

Предыдущее
От: "Phil McGlauchlin"
Дата:
Сообщение: Where can I get documentation on the using the JDBC interface?
Следующее
От: "Adrian Camero"
Дата:
Сообщение: Password for PostgreSQL user