Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> rOracle JDBC drivers and setting NLS_DATE_FORMAT in a logon trigger doesn't work

rOracle JDBC drivers and setting NLS_DATE_FORMAT in a logon trigger doesn't work

From: Andre van Winssen \(andrew\) <andrew-no-spam-svp_at_info.nl>
Date: Mon, 18 Mar 2002 14:18:43 +0100
Message-ID: <3c95e933$0$11068$4d4ebb8e@news.nl.uu.net>


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 Winssen
Received on Mon Mar 18 2002 - 07:18:43 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US