-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Unicode in HQL query
PostPosted: Fri Jan 20, 2006 1:48 pm 
Newbie

Joined: Fri Jan 20, 2006 1:32 pm
Posts: 11
Hibernate version:
3.0.5

Hi,
here is my code where i'am using unicode characters:

Code:
name="Petr Čáp";
System.out.println(">>>> " + name);
Query result = session.createQuery("select c from User as c where name = '" + name +"'");


ant here is what i'm getting in console:

Code:
>>>> Petr Čáp
Hibernate: select user0_.id as id, user0_.name as name0_, user0_.password as password0_, user0_.role as role0_ from user user0_ where name='Petr Čáp'


so nobody is found in database.

Source is in UTF-8 and I tried these url to connect:
url="jdbc:mysql://localhost/domas?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8"
url="jdbc:mysql://localhost/domas?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8"

Can anynody help to solve this problem?

Thank you


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 20, 2006 4:36 pm 
Newbie

Joined: Fri Jan 20, 2006 1:32 pm
Posts: 11
hibernate 3.1.1 solved it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.