• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Getting ".0" extra in date !!

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
I am using Oracle-8i as DB. I am using thin driver to connect to Oracle thru Java. In Oracle I have table name testdate having field datecol as date type.
I am following NLS_DATE_FORMAT as 'yyyy-mm-dd hh24:mi:ss' in the Oracle.
Now problem is when I fired query Select datecol from testdate from Java class It gives datecol return value as 2002-02-09 04:34:00.0
Why this .0 is appended in the result ???
One strange thing is that when I fired same query in the SQL prompt of ORACLE it gives proper result as 2002-02-09 04:34:00
Please help me ASAP.It's Urgent !!
Thanks
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How is this difference causing you problems? It seems like the data is correct, just formatted differently. If you want the date in a certain format then you just use SimpleDateFormat after you retrieve the date, and make it any format you want. It would also help if you posted the code that was giving you trouble.
Jamie
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Prady"
Your name doesn't agree with the javaranch guidelines. Please take a moment and edit your profile after reviewing the guidelines at http://www.javaranch.com/name.jsp
Please change your Publicly Displayed name to follow the guidelines.
thanks for your cooperation.
- satya
 
reply
    Bookmark Topic Watch Topic
  • New Topic