Forums Register Login

Setting date to oracle using Prepared Statement

+Pie Number of slices to send: Send
Hi,
I am setting date to oracle using prepared statement.I am using the following code

In database it is setting date alone but not the hour,minute and sec.I need to set the date with hour,minute & sec.

Regards
Vasu
[ February 29, 2004: Message edited by: Vasudevan Gopalan ]
+Pie Number of slices to send: Send
Pass following method in your java.sql.Date constructure
System.currentTimeMillis()
Hope this works
Chakk de
Bikram
+Pie Number of slices to send: Send
Sorry to tell you one thing more..
may be your database field would be Date type only instead of DateTime or timestamp..
Chakk de
Bikram
+Pie Number of slices to send: Send
Moving this to the JDBC forum...
+Pie Number of slices to send: Send
java.sql.Date will only fill out the date portion;
java.sql.Timestamp will fill in both portions

- Chris
+Pie Number of slices to send: Send
Thanks Christopher...
Skool. Stay in. Smartness. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 6176 times.
Similar Threads
Convert to timestamp yyyy-MM-dd hh:mm:ss a
Converting Textfield to Date field
Date method
What fields does java.util.Date.equals compare?
Slightly confused about Calendar Object
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 03:19:31.