This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Timestamp problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Timestamp problem" Watch "Timestamp problem" New topic

Timestamp problem

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 573
I am building the Dukes bank example using an Oracle Databsae.

In the Database they have a datatype TIMESTAMP.

In the code they have this data set as DATE. this is causing an error to be thrown as invalid column type.

I guess one way would be to change DATE to TIMESTAMP

Is there another way round this.

Thanks for any help Tony
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1121


I guess one way would be to change DATE to TIMESTAMP

Don't you mean: change TIMESTAMP to DATE?
Oracle does also have a DATE data-type -- which contains a "date" part and a "time" part. The TIMESTAMP type is new in Oracle 9i and adds a "fraction-of-second" part to the "date" and "time" parts. So go ahead, change your database column's data-type from TIMESTAMP to DATE.

Good Luck,
subject: Timestamp problem
Similar Threads
f:convertDateTime and data type conversion
How to convert timeStamp into corresponding date.
add 10 days to currentDate in java.util.Date or cast to Calendar?
bean:write datetime
Counting number of weeks using timestamp