Forums Register Login

Inserting date in database

+Pie Number of slices to send: Send
hi,
IN JSP, i have a problem in inserting today's date into a database ,please suggest me .
Thanks
Ramkumar.c
+Pie Number of slices to send: Send
Hi,

First of get the current date by using Java.util.Date. After that using JDBC API insert the corresponding values into the database.
Let me know if u have still probelem.
Thanks

Originally posted by ramkumar chandramohan:
hi,
IN JSP, i have a problem in inserting today's date into a database ,please suggest me .
Thanks
Ramkumar.c


+Pie Number of slices to send: Send
hi,
ya first using the calendar class i got the today's date ,when i trying to insert into the database i am geting a problem.Then by using util.Date i tried still i am getting a problem ,so please help me out with more details.
Thanks
Ramkumar.c
+Pie Number of slices to send: Send
what exactly is your problem?
- the date not being inserted correctly?
- the date being inserted as a different date?
- the date not being inserted at all?
- an exception being thrown?
+Pie Number of slices to send: Send
hi ,
Ya,date not being inserted at all and the exception being thrown

Originally posted by dagmar timler:
what exactly is your problem?
- the date not being inserted correctly?
- the date being inserted as a different date?
- the date not being inserted at all?
- an exception being thrown?


+Pie Number of slices to send: Send
okay. what is the exception?
+Pie Number of slices to send: Send

you need to get your date string in the proper format meaning get it in the format
"01-12-1999 12:00:00" and insert into the database field which is of DATE type

+Pie Number of slices to send: Send
hi dharmesh,
Thanks for ur timely help.
bye
C.Ramkumar

Originally posted by Dharmesh Chheda:
[B]
you need to get your date string in the proper format meaning get it in the format
"01-12-1999 12:00:00" and insert into the database field which is of DATE type
[/B]


F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2174 times.
Similar Threads
inserting date and time into database
inserting date and time into database
Date
Date Insertion using XSU...
Java date to MySQL date conversion
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 17:55:50.