Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes getObject() method is not returning the proper result. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "getObject() method is not returning the proper result." Watch "getObject() method is not returning the proper result." New topic
Author

getObject() method is not returning the proper result.

nitss bhavsar
Ranch Hand

Joined: Jan 09, 2012
Posts: 55
hello,
I am writing jdbc code that firing a query "select sysdate from dual" on database so, when i get the result from that by invoking getObject() method on result set ,is giving me only date not time...but my expected result should be like it should return date and time both.

my code is



getting result:
2012-04-12 00:00:00.0

expected result:
2012-04-12 15:36:56.0

so please do reply its urgent,
regards
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

have you tried getting the datatype from the metadata? and using that to use the more appropriate get method, so you want to use getDate().

I know oracle returns all number as NUMBER setting the precision and length, so I THINK oracle is quite good in it's meta data returned.
 
GeeCON Prague 2014
 
subject: getObject() method is not returning the proper result.