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

Re: [QUESTIONS] Accessing Postgresfrom JBuilder using JDBC

From: Patrick Scott Pierce <pspierce(at)slacker(dot)design(dot)mindspring(dot)net>
To: Peter T Mount <postgresdev(at)maidast(dot)demon(dot)co(dot)uk>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [QUESTIONS] Accessing Postgresfrom JBuilder using JDBC
Date: 1998-03-25 23:40:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces

In case anyone ask:

Here is what I did to to get the proper Timestamp:
  public Timestamp getTimestamp(int columnIndex) throws SQLException
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:sszzz");
    String s = getString(columnIndex);
    if (s != null)
        try {
          java.util.Date d = df.parse(s);
          return new Timestamp(d.getTime());
        } catch (ParseException e) {
          throw new SQLException("Bad Timestamp Format: at " +
e.getErrorOffset() + "
 in " + s);
    return null;                // SQL NULL

It allows me to update Timestamp on jbuilder.  I don't know what the
ramifications are elsewhere.

I never did look into the authorization wierdness.  Frankly, it works and
I don't have time to figure out why ;)  I did some stuff to getDate to get
it to work for me as well if anyone has a problem.  I don't know how much
of this would effect people not using jbuilder so it may be a moot point.

Patrick Scott Pierce
CGI Programming
Mindspring Enterprises

On Tue, 24 Mar 1998, Peter T Mount wrote:

> Date: Tue, 24 Mar 1998 19:41:53 +0000 (GMT)
> From: Peter T Mount <postgresdev(at)maidast(dot)demon(dot)co(dot)uk>
> To: Patrick Scott Pierce <pspierce(at)slacker(dot)design(dot)mindspring(dot)net>
> Cc: pgsql-interfaces(at)postgreSQL(dot)org
> Subject: Re: [QUESTIONS] Accessing Postgresfrom JBuilder using JDBC
> On Tue, 24 Mar 1998, Patrick Scott Pierce wrote:
> > It would seem that the Timestamp in the getTimestamp method in
> > is adding three hours to the time.  I hacked it up and
> > simply parsed up what was coming in, created a new Timestamp and it still
> > added one hour.  I then subtract a single hour but this is not the best
> > solution although it works and I can now save Timestamps back to the
> > database.
> I have come across this before. If you look at the driver source, you'll
> see a hack which adds a day when creating a Date object. It's caused by an
> obscure bug in the JDK (seen it in 1.1.3 & 1.1.5)
> > PS. This thread should probably move over to the interfaces list.
> Good idea.
> -- 
> Peter T Mount  petermount(at)earthling(dot)net or pmount(at)maidast(dot)demon(dot)co(dot)uk
> Main Homepage:
> Work Homepage: Work EMail: peter(at)maidstone(dot)gov(dot)uk

In response to


pgsql-interfaces by date

Next:From: Patrick Scott PierceDate: 1998-03-25 23:42:19
Previous:From: Jose' Soares Da SilvaDate: 1998-03-25 15:31:55
Subject: Re: [INTERFACES] About the char16 and char(16);

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