-->
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.  [ 2 posts ] 
Author Message
 Post subject: extract month from timestamp
PostPosted: Wed Mar 12, 2008 7:05 am 
Newbie

Joined: Wed Mar 05, 2008 6:03 am
Posts: 3
Iam having a timestamp column. how to extract the month from the timestamp type column in hibernate


Top
 Profile  
 
 Post subject: Re: extract month from timestamp
PostPosted: Wed Mar 12, 2008 7:22 am 
Beginner
Beginner

Joined: Tue Feb 26, 2008 2:04 pm
Posts: 28
Location: UK
prakashmvs wrote:
Iam having a timestamp column. how to extract the month from the timestamp type column in hibernate


Hi,

If you have a timestamp column in your db at an SQL level this means that you have mapped that as ‘timestamp’ in .hbm and you have either a java.util.Date or java.sql.Timestamp defined in your POJO.

So, having a Date object at a POJO level you can manipulate it using a Calendar instance and setting its time according to your Date field.


mosa


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

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.