pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oscar Serrano <oserra@fondos.net>
To: pgsql-interfaces@postgreSQL.org
Subject: datetime, JDBC, and MS Access
Date: Sat, 27 Nov 1999 21:44:44 +0100
Message-ID: <001401bf3918$4ec820c0$a778ebc3@pep> (raw)
References: <E11rhzG-0002Np-00@quartz.newn.cam.ac.uk>

Hi:
Probably someone of you can tellme what am I doing wrong:

I create a table in psql, with an unique column of the type "date" wich name
is "columdate".
Then, via JDBC, I try to put the content of that column in a Java Date
object. OK, no problem. I write this:

Date mydate=rs.getDate("columndate");

Now I can operate with mydate normaly.

But the PROBLEM is when in psql, the column "columndate" is of the type
"datetime". In that case, the java sentence puts null to mydate.

Why as "date" works and as "datetime" it doesn't work?

If also tried this:
Timestamp mydate=rs.getTimestamp("columndate");

but it doesn't work.

I would define de column as "date" the problem is solved, but, you know, the
tables are created exporting them from MS Access via ODBC, and when exported
so, postgresql converts to "datetime" all columns that in MS Access were of
the type "Date/Hour".

I could get my problem solved if some of you knows how to tell Access to
export "Date/Hour" types to postgresql "date" in side of  "datetime".

Thank you very much.





Message-ID: <001401bf3918$4ec820c0$a778ebc3@pep>
Permalink:  ../001401bf3918$4ec820c0$a778ebc3@pep/
Also on:    postgresql.org/message-id/001401bf3918$4ec820c0$a778ebc3@pep

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: oserra@fondos.net
  Subject: Re: datetime, JDBC, and MS Access
  In-Reply-To: <001401bf3918$4ec820c0$a778ebc3@pep>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox