-->
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: timestamp in servlet
PostPosted: Mon Mar 30, 2009 3:27 am 
Newbie

Joined: Thu Mar 26, 2009 4:41 am
Posts: 2
I have defined 1 column in table as Created_On with type as timestamp.
Now, when in servlet i am writing sad.setACreatedOn(timeStamp);
sad is the object.

Even on writing it in try-catch block:-

timestampDate = request.getParameter("timestamp");

try{
DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");

Date dob = (Date)formatter.parse(date);
Date timeStamp = (Date)formatter.parse(timestampDate);
sad.setDob(dob);
sad.setACreatedOn(timeStamp);
sad.setALastUpdatedOn(timeStamp);
} catch (ParseException pe){
log.error(pe.getMessage());
log.error(pe.getLocalizedMessage());
}
catch(Exception e)
{
log.error(e.getMessage());
}

It is giving error.
Is it the Correct way?
Give suggestions


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 02, 2009 1:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Not sure what you are asking about ?

how is this related to hibernate tools ?

_________________
Max
Don't forget to rate


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.