| Author |
Setting date to oracle using Prepared Statement
|
Vasudevan Gopalan
Ranch Hand
Joined: Aug 29, 2003
Posts: 67
|
|
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 ]
|
 |
Bikramjit Singh Bajwa
Ranch Hand
Joined: Nov 23, 2003
Posts: 39
|
|
Pass following method in your java.sql.Date constructure System.currentTimeMillis() Hope this works Chakk de Bikram
|
 |
Bikramjit Singh Bajwa
Ranch Hand
Joined: Nov 23, 2003
Posts: 39
|
|
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
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
|
Moving this to the JDBC forum...
|
[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
|
 |
Christopher Zinn
Greenhorn
Joined: Nov 03, 2003
Posts: 13
|
posted

0
|
java.sql.Date will only fill out the date portion; java.sql.Timestamp will fill in both portions - Chris
|
 |
Vasudevan Gopalan
Ranch Hand
Joined: Aug 29, 2003
Posts: 67
|
|
|
Thanks Christopher...
|
 |
 |
|
|
subject: Setting date to oracle using Prepared Statement
|
|
|