You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Harald Henkel <h....@gs-automation.de> on 2004/11/23 16:02:24 UTC

Data sorting problem Tomcat<->Oracle

Hello all.

I have a strange problem with data sorting using an Oracle 8.1.7
database.

I set the database to use binary sorting (NLS_SORT=BINARY), independent
from GERMAN language setting.
When I'm doing a select on a table with values like
A1, A2, ... AA, AB, ... I get the correct result according to binary
sorting.
Yet, if I'm doing this from Tomcat (4.1.24 on WinXP) the data returned
is sorted in GERMAN sorting 
order, i.e. AA, AB, ..., A1, A2, ...

So it seems either Tomcat ignores the setting of the NLS_SORT
environment variable,
or it is implicitly (by Tomcat) or explicitly (by some library code,
which I didn't find yet) overridden.

Anybody got an idea, of which might be the case ?

Thanks in advance,
Harald Henkel

-- 
Harald Henkel

GS automation GmbH
Winterstraße 2
82223 Eichenau
Germany
Tel:    + 49-8141-35 731-37
Fax:    + 49-8141-35 731-38
Mobile: + 49-178-7829126
e-mail: H.Henkel@GS-automation.DE
Web:    www.GS-automation.DE

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Data sorting problem Tomcat<->Oracle

Posted by Harald Henkel <h....@gs-automation.de>.
Hello Tim.

Thanks, I got at last a working solution.

Tim Funk wrote:
> 
> Ahhh. The archives have a lot of references about System environment
> variables not being set when run as a service.

I guess it doesn't have too much to do with that. I now tested running
it standalone.

> If you are using the type 4 driver - I don't think it looks for Environment
> variables or the registry since the driver is pure java. Oracle's support
> would probably be more helpful for the appropriate connection string. (Or
> setting)

That was a good hint. Indeed I'm usually using a Jdbc Thin driver and I
looked into some Oracle newsgroup.

I tried starting Tomcat standalone adding a -Duser.language=en into the
java starting command.

And this works.

Again, thanks for the hint, I wasted a lot of time on this one.
Should really ask earlier.

With kind regards,
Harald Henkel

> 
> -Tim
> 
> Harald Henkel wrote:
> >
> > Tim Funk wrote:
> >
> >>Tomcat knows nothing about NLS_SORT.
> >>
> >>Odds are NLS_SORT is probably not set when running on XP.
> >
> >
> > ???
> > Oracle usually sets values in the registry, and by default only
> > NLS_LANG, from which the other values are derived.
> > If you want to change the defaults, you could either define registry
> > entries for those, or set environment variables.
> >
> > I use Tomcat as service on NT.
> > Could it be, that it doesn't get the System environment varible ?
> > I will try starting Tomcat from the CMD.
> >
> > Regards,
> > Harald Henkel
> >
> >
> >>-Tim
> >>
> >>Harald Henkel wrote:
> >>
> >>
> >>>Hello all.
> >>>
> >>>I have a strange problem with data sorting using an Oracle 8.1.7
> >>>database.
> >>>
> >>>I set the database to use binary sorting (NLS_SORT=BINARY), independent
> >>>from GERMAN language setting.
> >>>When I'm doing a select on a table with values like
> >>>A1, A2, ... AA, AB, ... I get the correct result according to binary
> >>>sorting.
> >>>Yet, if I'm doing this from Tomcat (4.1.24 on WinXP) the data returned
> >>>is sorted in GERMAN sorting
> >>>order, i.e. AA, AB, ..., A1, A2, ...
> >>>
> >>>So it seems either Tomcat ignores the setting of the NLS_SORT
> >>>environment variable,
> >>>or it is implicitly (by Tomcat) or explicitly (by some library code,
> >>>which I didn't find yet) overridden.
> >>>
> >>>Anybody got an idea, of which might be the case ?
> >>>
> >>>Thanks in advance,
> >>>Harald Henkel
> >>>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

-- 
Harald Henkel

GS automation GmbH
Winterstraße 2
82223 Eichenau
Germany
Tel:    + 49-8141-35 731-37
Fax:    + 49-8141-35 731-38
Mobile: + 49-178-7829126
e-mail: H.Henkel@GS-automation.DE
Web:    www.GS-automation.DE

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Data sorting problem Tomcat<->Oracle

Posted by Tim Funk <fu...@joedog.org>.
Ahhh. The archives have a lot of references about System environment 
variables not being set when run as a service.

If you are using the type 4 driver - I don't think it looks for Environment 
variables or the registry since the driver is pure java. Oracle's support 
would probably be more helpful for the appropriate connection string. (Or 
setting)

-Tim

Harald Henkel wrote:
> 
> Tim Funk wrote:
> 
>>Tomcat knows nothing about NLS_SORT.
>>
>>Odds are NLS_SORT is probably not set when running on XP.
> 
> 
> ???
> Oracle usually sets values in the registry, and by default only
> NLS_LANG, from which the other values are derived.
> If you want to change the defaults, you could either define registry
> entries for those, or set environment variables.
> 
> I use Tomcat as service on NT.
> Could it be, that it doesn't get the System environment varible ?
> I will try starting Tomcat from the CMD.
> 
> Regards,
> Harald Henkel
> 
> 
>>-Tim
>>
>>Harald Henkel wrote:
>>
>>
>>>Hello all.
>>>
>>>I have a strange problem with data sorting using an Oracle 8.1.7
>>>database.
>>>
>>>I set the database to use binary sorting (NLS_SORT=BINARY), independent
>>>from GERMAN language setting.
>>>When I'm doing a select on a table with values like
>>>A1, A2, ... AA, AB, ... I get the correct result according to binary
>>>sorting.
>>>Yet, if I'm doing this from Tomcat (4.1.24 on WinXP) the data returned
>>>is sorted in GERMAN sorting
>>>order, i.e. AA, AB, ..., A1, A2, ...
>>>
>>>So it seems either Tomcat ignores the setting of the NLS_SORT
>>>environment variable,
>>>or it is implicitly (by Tomcat) or explicitly (by some library code,
>>>which I didn't find yet) overridden.
>>>
>>>Anybody got an idea, of which might be the case ?
>>>
>>>Thanks in advance,
>>>Harald Henkel
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Data sorting problem Tomcat<->Oracle

Posted by Harald Henkel <h....@gs-automation.de>.

Tim Funk wrote:
> 
> Tomcat knows nothing about NLS_SORT.
> 
> Odds are NLS_SORT is probably not set when running on XP.

???
Oracle usually sets values in the registry, and by default only
NLS_LANG, from which the other values are derived.
If you want to change the defaults, you could either define registry
entries for those, or set environment variables.

I use Tomcat as service on NT.
Could it be, that it doesn't get the System environment varible ?
I will try starting Tomcat from the CMD.

Regards,
Harald Henkel

> 
> -Tim
> 
> Harald Henkel wrote:
> 
> > Hello all.
> >
> > I have a strange problem with data sorting using an Oracle 8.1.7
> > database.
> >
> > I set the database to use binary sorting (NLS_SORT=BINARY), independent
> > from GERMAN language setting.
> > When I'm doing a select on a table with values like
> > A1, A2, ... AA, AB, ... I get the correct result according to binary
> > sorting.
> > Yet, if I'm doing this from Tomcat (4.1.24 on WinXP) the data returned
> > is sorted in GERMAN sorting
> > order, i.e. AA, AB, ..., A1, A2, ...
> >
> > So it seems either Tomcat ignores the setting of the NLS_SORT
> > environment variable,
> > or it is implicitly (by Tomcat) or explicitly (by some library code,
> > which I didn't find yet) overridden.
> >
> > Anybody got an idea, of which might be the case ?
> >
> > Thanks in advance,
> > Harald Henkel
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

-- 
Harald Henkel

GS automation GmbH
Winterstraße 2
82223 Eichenau
Germany
Tel:    + 49-8141-35 731-37
Fax:    + 49-8141-35 731-38
Mobile: + 49-178-7829126
e-mail: H.Henkel@GS-automation.DE
Web:    www.GS-automation.DE

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Data sorting problem Tomcat<->Oracle

Posted by Tim Funk <fu...@joedog.org>.
Tomcat knows nothing about NLS_SORT.

Odds are NLS_SORT is probably not set when running on XP.

-Tim

Harald Henkel wrote:

> Hello all.
> 
> I have a strange problem with data sorting using an Oracle 8.1.7
> database.
> 
> I set the database to use binary sorting (NLS_SORT=BINARY), independent
> from GERMAN language setting.
> When I'm doing a select on a table with values like
> A1, A2, ... AA, AB, ... I get the correct result according to binary
> sorting.
> Yet, if I'm doing this from Tomcat (4.1.24 on WinXP) the data returned
> is sorted in GERMAN sorting 
> order, i.e. AA, AB, ..., A1, A2, ...
> 
> So it seems either Tomcat ignores the setting of the NLS_SORT
> environment variable,
> or it is implicitly (by Tomcat) or explicitly (by some library code,
> which I didn't find yet) overridden.
> 
> Anybody got an idea, of which might be the case ?
> 
> Thanks in advance,
> Harald Henkel
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org