Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> rOracle JDBC drivers and setting NLS_DATE_FORMAT in a logon trigger doesn't work
Hi,
through the hard way (sql_trace=true !) I discovered why using a
LOGON trigger (whether on database or schema level) to set
NLS_DATE_FORMAT does not work for Oracle JDBC drivers.
In sqlplus this method for setting nls values works fine but the Oracle JDBC
driver seems to overrule the settings made by the logon trigger by issueing
ALTER SESSION statement for NLS_DATE_FORMAT,
NLS_TERRITORY & NLS_LANGUAGE.
One solution is to set init.ora parameter nls_date_format since this
setting will be reflected in NLS_INSTANCE_PARAMETERS that is queried
by the jdbc driver code, but this solution does not work if you have
different
java applications using the same database and requesting different NLS
settings.
Another solution is to issue ALTER SESSION SET NLS_DATE_FORMAT
in the class file itself but isn't that expensive?
There's no difference between 8i and 9i Oracle JDBC drivers.
Did anybody ran into the same problem before and found better alternatives for manipulating NLS settings for Java applications without hardcoding alter session stmts?
-- Andre van WinssenReceived on Mon Mar 18 2002 - 07:18:43 CST