db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: Accent-insensitive searches
Date Tue, 15 Sep 2009 08:27:33 GMT
josu <josu.eh.mondo@gmail.com> writes:
> Knut Anders Hatlen wrote:
>> 
>> You can verify that the database was created with the correct territory 
>> and collation by evaluating this in IJ and see that "TERRITORY_BASED" is 
>> returned: 
>> ...
>> And also check that service.properties in the database directory 
>> contains the following line: 
>>  
>> derby.serviceLocale=es_ES_accentinsensitive 
>> 
>
> I checked both, and they're ok. But the result of the queries is still
> accent-sensitive. I'm working with Windows XP and it seems you're working
> with Linux, could that be the reason of the different behaviour?

Maybe. I've only tried it on Solaris, and I don't know if there are any
differences on other platforms.

To check that the Java VM picks up your collator correctly, you could
try this code and see what it prints:

    Locale locale = new Locale("es", "ES", "accentinsensitive");
    Collator c = Collator.getInstance(locale);
    System.out.println(c.compare("electrico", "el├ęctrico"));

"0" should be printed if your custom collator has been correctly
installed.

-- 
Knut Anders

Mime
View raw message