This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a column with "DATE" as datatype ..As part of a batch process I need to insert the start date and time into that (YYYY-MM-DD HH24:MI:SS). If i use just the Statement and the to_date function in the "values" clause it works ..but this is an existing application using "Prepared Statement" and we're migrating from sybase to oracle. When I am trying to use the setDate function it is just inserting the date part and putting zeros (00:00:00) for time part where as in sybase just the setString was taking care of everything ... Any suggestions please ...
Have you tried using the setTimestamp() method on the Prepared Statement ? e.g. java.util.Date now = new java.util.Date(); ps.setTimestamp( new java.sql.Timestamp(now.getTime()) ); I think that the setDate() method only sets the date portion of the DateTime column. HTH
Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams