• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getObject() method is not returning the proper result.

 
nitss bhavsar
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic