-->
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.  [ 3 posts ] 
Author Message
 Post subject: working with date
PostPosted: Tue Apr 24, 2007 10:59 pm 
Newbie

Joined: Sat Nov 25, 2006 12:02 am
Posts: 4
Hi,

What is the best class when working with dates (no need for time)? There is java.util.Date, java.util.GregorianCalendar, java.sql.Date. It seems that java.util.Date and java.sql.Date is being depreciated. I am got a feeling that java.util.GregorianCalendar is slow? Is it true? Does it uses more resources compare to java.util.Date or java.sql.Date? Should I worry if I use java.util.GregorianCalendar

Thanks
james


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 8:37 am 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
java.util.Date is what I use...don't worry, it is not going to be deprecated. There are a lot of deprecated constructors and methods, but java.util.Date (and to a lesser extent java.sql.Date) remains the only value object representing a physical date. The Calendar class is more of a strategy class, and it does increase overhead, using more resources.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 30, 2007 11:27 pm 
Beginner
Beginner

Joined: Wed Feb 14, 2007 10:43 am
Posts: 21
There is a problem when you map your dates with java.util.Date. We have DB2 on Linux and java.util.Date mapped to a Date worked fine. We switched our database to DB2 on Mainframe and the app broke. We changed the mapping to java.sql.Date and it worked.

Anybody experienced the same problem?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.