Reputation: 753
I have an Oracle database, and a Java program to access it through OJDBC. The sql DATE data type contains complete date and time information. The Java SQL libraries have 2 separate data types for Date and Time.
What's the easiest way to get around this whole stupid mess? Is it possible to write and read both time and date information from the SQL DATE type? Can I write a Timestamp to the database and have it save as a DATE type?
Upvotes: 1
Views: 5293
Reputation: 4022
With version 9.2, use resultSet.getTimestamp, with version 11 JDBC driver, DATE should map automatically to the Timestamp java type.
Upvotes: 2