wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
 
Similar Threads
Iterating Through Dates
Regarding HttpSession
inputCalendar and commandButton
Calendar Highlight with Group Selection
Comparing Dates