Using SYSDATE in a PreparedStatement
I feel sure this must have done already, but ....
I need to use a PreparedStatement to insert rows. The table has a DATE column and I want to use the SYSDATE value.
I've tried using setString("SYSDATE") and setObject("SYSDATE") but I'm getting ORA-01585 errors each time.
What's the "official" mechanism for doing this?
I can't use a Date object from the client because I can't be sure the clent and server clocks will be in sync.
I also can't do SELECT SYSDATE FROM DUAL because the PreparedStatement is batched and I want the timestamp from
when the row actually hits the DB.
Any suggestions welcome.
Thanks in advance.
Andy