-->
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: select vs insert involving non-ascii characters issue
PostPosted: Sun Jan 11, 2009 4:22 am 
Newbie

Joined: Thu Jul 31, 2008 2:15 am
Posts: 7
Location: LONDON
We are having a problem with a conflict between a select HQL and an insert. We perform a select on an object to check if the value is already in the table. When the select results with no entries we insert that value. The table has a unique index.

What happens is that the select indicates the value is not in the table but the insert fails because of a duplicate entry (which indicates the value is actually in the table - and this is actually the truth - the value is there but the select does not find it).

This situation occurs to non-ascii characters eg characters that are accented eg 'é'.

All values in the db for character set is UTF8 and it seems that collation values are UTF8 as well. Not sure which parameters are actually involved here regarding this situation.

Any ideas?

Many thanks
Jeremy


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 12, 2009 6:23 am 
Regular
Regular

Joined: Wed Oct 15, 2008 6:59 am
Posts: 103
Location: Chennai
u have to set character encoding to UTF8 in connectio url like these

jdbc:mysql://localhost/mydb?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8

take a view these URL..http://www.whirlycott.com/phil/2006/05/ ... bernate-3/

_________________
If u feel it will help you, don't forget to rate me....


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.