Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!wns13feed!worldnet.att.net!12.120.4.37!attcg2!attsl2!attsl1!ip.att.net!kcweb01.netnews.att.com!not-for-mail
From: "Spare Brain" <spare_brain@yahoo.com>
Newsgroups: comp.databases.oracle,comp.databases.oracle.misc,comp.databases.oracle.server,comp.lang.java.databases
Subject: Re: Can you help me with JDBC getDate() error?
Date: Tue, 1 Feb 2005 22:03:58 -0500
Organization: ITS - NetNews
Lines: 41
Message-ID: <ctpeti$8d4@kcweb01.netnews.att.com>
References: <ctp9m2$8d3@kcweb01.netnews.att.com> <42003788.1050606@bea.com>
NNTP-Posting-Host: 135.70.140.58
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Xref: dp-news.maxwell.syr.edu comp.databases.oracle:29235 comp.databases.oracle.misc:116120 comp.databases.oracle.server:234761 comp.lang.java.databases:51159

"Joe Weinstein" <joeNOSPAM@bea.com> wrote in message
news:42003788.1050606@bea.com...
>
>
> Spare Brain wrote:
>
> > Hi,
> >
> > I am observing a strange error with the time portion of the
java.sql.Date()
> > when using resultSet.getDate() - it always seems to show 12:00:00.
> >
> > The following code prints 2004-10-27 11:00:00.0
> >
> >   String dtStr = resultset.getString("PROMISEDATE");
> >   System.out.println(dtStr);
> >
> > The following code prints 2004-10-27 12:00:00
> >   java.util.Date dt = resultset.getDate("PROMISEDATE");
> >   System.out.println(new SimpleDateFormat("yyyy-MM-dd
> > hh:mm:ss").format(dt));
> >
> > Any clue why the getDate screws up the time? Any remedies you may
suggest?
>
> Yes, because it's a Date (date only). Try getTimestamp().
> Joe Weinstein at BEA
>
>
> >
> > Many thanks
> > SB
> >
> >
> >
>

That worked!!! Thanks Joe.
SB


