0

I have DATE column in db - when select it through PL/SQL Developer I can see real whole date?as is is stored in database. When I debug my jdbc template class I can see that everything including date is read as an object: Object obj = cursor.getObject(ii + 1); from ResultSet According to JDBC spec the implicit conversion from Oracle DATE type takes place and we get java.util.Date. Everything worked good until one day Oracle updated its driver and now I can see that he deletes the time of the date. The day comes OK. But the time is midnight. Did anyone of you faced the issue?

Thx in advance.

AlexInspired
  • 91
  • 2
  • 12
  • ANSI-SQL-DATE is not supposed to have a time part. Oracle just tries to follow this definition of column type. All OK. If you want date AND time then you have to choose the column type TIMESTAMP. – Meno Hochschild Apr 03 '14 at 16:22
  • use `ResultSet.getTimestamp()`. For your ancient driver you can also use the connection property: `oracle.jdbc.mapDateToTimestamp` http://stackoverflow.com/q/383783/330315 –  Apr 03 '14 at 16:52
  • @MenoHochschild No, if the poster really meant the Oracle data type `DATE`, there should be a time portion along with the date portion according to [this doc](http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements001.htm#i54330). The Oracle `DATE` is different than a standard `DATE`, apparently predating the standard. An Oracle DATE has a time while a standard DATE does not. – Basil Bourque Apr 03 '14 at 18:33
  • @BasilBourque You are right, and we learn how poor the standardization of SQL is. – Meno Hochschild Apr 03 '14 at 22:50

0 Answers0