This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Java in General and the fly likes Date problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Date problem" Watch "Date problem" New topic

Date problem

Kedar Dravid
Ranch Hand

Joined: May 28, 2004
Posts: 333
I am having a problem retrieving dates.
I have a Java class in which I am retrieving dates from an Oracle database.
When I call the Java class directly, I a getting the date correctly, but when I call the Java class from Tomcat, the time too is getting appended to the date as 00:00:00. The database entry contains only the date, not the time.
Jeremy Wilson
Ranch Hand

Joined: Feb 18, 2003
Posts: 166
What is the data type of the column in oracle. If the data type is date the timestamp is included down to the second. It is a date formatting issue you get into at that time. If you are trying to display the date on the web try using a SimpleDateFormat object to translate the date to only display the date, The timestamp will still be there as part of the object.

Jeremy Wilson
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Date problem
It's not a secret anymore!