If your java program expects the same date format from/to all databases then you can set your default NLS_DATE_FORMAT as an environment variable on unix or in the windows registry.
This alter session statement cannot be passed to the DBCP connection engine right now. But it is an interesting feature for a future version if it is generic enough. (executing a statement on creation/activation of a connection).
-- Dirk
Keates, Mark wrote:
Hi,
When using a servlet engine to connect to different Oracle databases, which can have differing default date formats, is it the responsibility of the servlet to execute an ALTER SESSION if I want to use a specific date format in my queries? E.g.
Connection con = ds.getConnection(); Statement s = con.createStatement(); s.execute("alter session set NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"); ... s.close(); con.close();
Or can this be passed to the DBCP connection engine somehow so that when a new connection is established the correct date format is set? This problem has come about since the introduction of
'timeBetweenEvictionRunsMillis'
into the DB ResourceParams section within server.xml.
I'd rather this was done than have to intersperce 'to_date' calls everywhere ;(
Thanks,
Mark
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
