You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Алексей Газукин <al...@gmail.com> on 2011/11/25 09:43:06 UTC

problem with sorting

Good day!
I have a question?
I use a database Derby and ran into this problem. I can normally sort the
values ​​of the database. In the database I'm using the Ukrainian language.
*My **query** looks like this "select * from TSOU.PUIPLE WHERE pgroup =5
and pyear=2011 order by SURNAME"*
after the query I get a table in the form (see attachment 1.png)
so looks correct (see attachment 2.png)
In MySQL the query is solved as follows  "*select * from TSOU.PUIPLE WHERE
pgroup =4 and pyear=2011 order by SURNAME **order by COLLATE
utf8_unicode_ci"*
I have tried to solve it this way, but results have not been
*"jdbc:derby:E:/myproject/jtsou/DB/TSOU;create=true;collation=TERRITORY_BASED:PRIMARY
"*
How can I make this query in Derby?

During the earlier grateful
-- 
Алексей Газукин

Re: problem with sorting

Posted by Rick Hillegas <ri...@oracle.com>.
Hi Алексей,

I don't know the specifics of the MySQL collations. Derby lets you 
select any collation/strength combination which is supplied with the 
JVM--from your connection URL it looks like you understand how to select 
a collation/strength combination. If the JVM doesn't supply the 
collation you need, you can always write your own. For details on how to 
do this, please take a look at 
http://blogs.oracle.com/kah/entry/user_defined_collation_in_apache

Hope this helps,
-Rick

On 11/25/11 12:43 AM, Алексей Газукин wrote:
> Good day!
> I have a question?
> I use adatabaseDerby andran intothis problem.I cannormallysort the 
> values​​of the database.In the databaseI'm usingthe Ukrainian language.
> *My**query**looks like this "select * from TSOU.PUIPLE WHERE pgroup =5 
> and pyear=2011 order by SURNAME"*
> after the queryI geta tablein the form (seeattachment1.png)
> solooks correct(seeattachment2.png)
> In MySQLthe queryis solved as follows  "*/select * from TSOU.PUIPLE 
> WHERE pgroup =4 and pyear=2011 order by SURNAME /**/order by COLLATE 
> utf8_unicode_ci"/*
> I have tried tosolveit this way,butresults have not been
> */"jdbc:derby:E:/myproject/jtsou/DB/TSOU;create=true;collation=TERRITORY_BASED:PRIMARY 
> "/*
> Howcan I makethis queryin Derby?
>
> During theearliergrateful
> -- 
> Алексей Газукин