I need to get today's date and insert into sql table.
Date d = new Date(); long today = now.getTime();
when I insert this value into sql table hour:min:sec is also inserted. please give me suggestions to get today's date in long value or in timestamp value without hr:min:sec attached to it.
thanks,
clio katz
Ranch Hand
Joined: Apr 30, 2004
Posts: 101
posted
0
if you're dealing with sql and java 1.4+, it will probably be helpful for you to review the java.sql and javax.sql API's right off
e.g.
if you don't have these packages, you can use milliseconds or Calendar class to construct a SQL DATE in the desired format.
hth!
somkiat puisungnoen
Ranch Hand
Joined: Jul 04, 2003
Posts: 1312
posted
0
If you want to use TimeStamp
Example code
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand