Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle Dates and Java Dates and selecting the former into the later

Re: Oracle Dates and Java Dates and selecting the former into the later

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Wed, 1 Jun 2005 21:12:33 -0700
Message-ID: <1YWdnSolV9VoGwPfRVn-tw@comcast.com>

<mike.jones_at_xenicom.com> wrote in message news:1117644939.793569.170860_at_f14g2000cwb.googlegroups.com...
> Good points well made... Adter getting an example the problematic
> approach seems to be doing the below, I've just copied the bit I think
> relevent but if you want more ask... I should aslo point out that this
> is connecting via weblogic. I have a feeling this is relevent.
>
> while (results.next()) {
> Object value = results.getObject(1);
> System.out.println("Class we got back is " +
> value.getClass().toString());
> System.out.println("Sysdate value = " +
> value.toString());
>
> It seems that as the type is a date (as the column is) it gets it back
> as a date and thus the time element disappears!!
>
> 2 Questions:
>
> Is my thinking right?
> Is there any known way of solving this issue?
>
> Thanks,
>
> Mike.
>

I think the problem is that the casting of an "Object" to a String is the problem. Shouldn't they cast it to a timestamp and then do a toString to a timestamp? I think the problem is in Java not Oracle. Well, not really not a problem with Java, but with the way they are using Java. Jim Received on Wed Jun 01 2005 - 23:12:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US