aspose file tools*
The moose likes JSP and the fly likes Inserting Date value by using JSP......Please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Inserting Date value by using JSP......Please help" Watch "Inserting Date value by using JSP......Please help" New topic
Author

Inserting Date value by using JSP......Please help

Vasanth Padmanaban
Greenhorn

Joined: Jul 04, 2002
Posts: 1
Hi,
I don't know how to insert date value into Database. Shall i use the following code:
date ToDate =ToMon+"/" + ToDay +"/"+ ToYear;


Padmanaban V<br />India
Val Pecaoco
Ranch Hand

Joined: Dec 05, 2001
Posts: 156
Hi Vasanth,
Try using date format classes on your date object to convert it into a date/time string. I normally use the DateFormat class from the java.text package, e.g.,

You can then insert formattedDate in a date/time table column.
Hope that helps.
Ex Animo Java!
-- Val


"Knowledge is power, but enthusiasm is the key." -- Lavern Barn
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inserting Date value by using JSP......Please help