title: OCI JDBC Driver and NLS Settings
body: <p>We have created a "after logon" trigger to alter the session in order to set the two NLS settings - NLS_SORT and NLS_COMP. NLS_SORT needs to be set to BINARY_CI and NLS_COMP needs to be set to LINGUISTIC. By querying the V$NLS_PARAMETERS view after establishing the connection to verify the values I see that NLS_COMP parameter gets updated but NLS_SORT doesn't. </p>
  
  <p>After researching more I realized that the OCI JDBC driver executes the below query after the connection is established</p>
  
  <pre><code>        ALTER SESSION SET NLS_LANGUAGE='AMERICAN' NLS_TERRITORY='AMERICA'
  </code></pre>
  
  <p>Since NLS_SORT derives its values from NLS_LANGUAGE, NLS_SORT parameter value resets to BINARY instead of BINARY_CI. The NLS_LANGUAGE setting is taken from windows registry.</p>
  
  <ol>
  <li><p>Does the oci jdbc driver execute these queries to synchronize the NLS settings on the client to that with the database server? </p></li>
  <li><p>Can the jdbc oci driver be configured to avoid executing the alter session set NLS_LANGUAGE query?</p></li>
  </ol>
  
  <p>The reason I ask the second question is that it doesn't make sense for application server (e.g glassfish, tomcat, jboss) machine (on which the OCI client is installed) settings to override the database server settings.</p>