-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Time missing from Oracle Date in Native Query ?
PostPosted: Wed Apr 28, 2010 12:12 pm 
Newbie

Joined: Wed Apr 28, 2010 11:55 am
Posts: 13
I have a native query that returns a date field (select ... EVENT_DATE ... from ...).

The Sql Mapping:
@SqlResultSetMapping(name = "resultSet",
columns = {
@ColumnResult(name = "STATUS_CD"),
@ColumnResult(name = "DESCRIPTION"),
@ColumnResult(name = "EVENT_DATE"),
@ColumnResult(name = "LOCATION")
})

I use:
private static final SimpleDateFormat eventDateFormat =
new SimpleDateFormat("MM/dd/yyyy hh:mm a");

eventDateFormat.format(_events[2]);

The time portion is always 0. (12:00 AM).

How can I retrieve the time portion from the DB ? I want to get it in Date format, not convert it in the SQL. Is this possible ?

Thanks,
Craig.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.