Oracle session timezone: Can Oracle DB session convert java.sql.Date to correct timezone?
Clash Royale CLAN TAG #URR8PPP Oracle session timezone: Can Oracle DB session convert java.sql.Date to correct timezone? We have an audit table( Columns/Types: ID/Number,.. Audited_Date/Date) which logs audit entries using prepared statements. Until now, for different contexts we set the database session timezone for the connection, after which we were using the CURRENT_DATE attribute for the audited_date column. THIS MEANT THAT THE DATE INSERTED INTO THE COLUMN IS IN THE TIMEZONE OF THE CONNECTION WHICH IS IMPORTANT. Now, we have a new requirement to add different dates based on the supplied timestamps for the audit logs. Similar to the previous approach where the auditing engine didn't have to worry about the timezone, is there a way to set the date for the column, WITHOUT having to do something like this: TimeZone timeZone = TimeZone.getTimeZone(timezone); calendar.setTimeZone(timeZone); preparedStatement.setDate(4, new java.sql.Date(userTimestampMillis), calendar); I would real...