Ordering through Weblogic Server
Today I had a bug in which the list of items I collected through a thin JDCBC Driver connection via a WebLogic Server to an Oracle database where not ordered correctly. I had submitted a select statement with an order by clause and the entries with Upper case where sorted before the entries with lower case. Strangely enough the same statement executed via JDeveloper (and the embeded Weblogic Server) had a different order strategy.
The conclusion is the following:
The database uses the order strategy depending on your NLS_SORT setting. If this is not set, it will look for the NLS_LANG setting.
JDBC will not use the NLS_LANG parameter set in your environment. Instead it will look for the locale settings. Therefore by setting the language and the region on startup of the java process the NLS_SORT parameter can be influenced. To do so start the java program as following:
java -Duser.lang=en -Duser.region=US <jdbc_program>
Alternatively, and this is what we did, you simply set the LANG parameter in your linux environment, e.g. LANG=de_DE.UTF-8









