dcsimg
How can I insert the value of SYSDATE, without JDBC code, in a CMP field
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   zhi_chou
Posted On:   Thursday, March 7, 2002 05:29 AM

How can I insert the value of SYSDATE, without JDBC code, in a CMP field (Timestamp->DATE)? Thanks!

Re: How can I insert the value of SYSDATE, without JDBC code, in a CMP field

Posted By:   Olivier_Michallat  
Posted On:   Tuesday, March 12, 2002 03:27 AM

When you use the default constructor of java.util.Date, it is initialized to the current date. From that point if you want a java.sql.Timestamp you can convert by using the long representation of the date.


So the following instruction should do it :


Timestamp myTimestamp = new Timestamp( new java.util.Date().getTime() );
About | Sitemap | Contact