Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] JDBC date problem

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: Aleksey Demakov <avd(at)gcom(dot)ru>
Cc: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [INTERFACES] JDBC date problem
Date: 1998-10-19 17:15:43
Message-ID: Pine.LNX.3.96.981019181225.31130h-100000@maidast.retep.org.uk (view raw or flat)
Thread:
Lists: pgsql-interfaces
On 19 Oct 1998, Aleksey Demakov wrote:

> Peter T Mount <peter(at)retep(dot)org(dot)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(at)gcom(dot)ru
> 

-- 
       Peter T Mount peter(at)retep(dot)org(dot)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


In response to

pgsql-interfaces by date

Next:From: Adrian CameroDate: 1998-10-19 17:57:27
Subject: Password for PostgreSQL user
Previous:From: Phil McGlauchlinDate: 1998-10-19 16:44:40
Subject: Where can I get documentation on the using the JDBC interface?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group