Java Date Hibernate cut off time

Posted by Vlad on Stack Overflow See other posts from Stack Overflow or by Vlad
Published on 2010-02-26T17:02:14Z Indexed on 2010/03/26 4:33 UTC
Read the original article Hit count: 387

Filed under:
|
|
|
|

Hi folks,

I have a Date type column in Oracle DB and it contains date and time for sure. But when I'm trying to get data in java application it will return date with bunch of zeros instead of real time. In code it'll be like:

SQLQuery sqlQuery = session.createSQLQuery("SELECT table.id, table.date FROM table");
List<Object[]> resultArray = sqlQuery.list();
Date date = (Date)resultArray[1];

If it was 26-feb-2010 17:59:16 in DB I'll get 26-feb-2010 00:00:00 How to get it with time?

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate