File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
 
Don't get me started about those stupid light bulbs.
 
subject: Inserting Date value by using JSP......Please help
 
Similar Threads
inputCalendar and commandButton
Calendar Highlight with Group Selection
Iterating Through Dates
Regarding HttpSession
Comparing Dates