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: ORDER BY and greek characters
Date Fri, 05 Dec 2008 15:34:18 GMT
Rick Hillegas <Richard.Hillegas@Sun.COM> writes:

> tom_ wrote:
>> I'm using ORDER BY and a database with collation territory based de_DE.
>> Strings starting with greek characters are at the end of the resultset.
>> Users would expect them near the respective latin character, e.g. greek
>> "alpha" near "a". Is there a possiblity to sort in this way?
>>     
> Hi Tom,
>
> Here a couple suggestions:
[...]
> 2) You could change Derby so that it supports user-defined Locales
> with custom collations. I haven't looked into the details here, but
> this seems like a smallish task--gated by a community discussion about
> how to declare these user-created Locales.
>
> + This would be generally useful.
> + Indexes would work for you and give your queries better performance.
> - This solution wouldn't hit production until Derby 10.5 at the earliest.

This can in fact be done with no changes to the Derby code, since Java
SE 6 has an API for defining custom locales and collation rules. I have
given an example of how you can use this to achieve what you want here:
http://blogs.sun.com/kah/entry/user_defined_collation_in_apache

Hope this helps,

-- 
Knut Anders

Mime
View raw message