• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

test™ (test with TradeMark symbol) inserting as 'test?' withHibernate and MySQL

 
Jaggit singh
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using Hibernate with MySQL. I have an object that holds field value test™ (test with TradeMark symbol), when I am trying to insert this object through saveorUpdate method, it is inserting value in the table as ‘test?’

It is correctly working with simple jdbc call.

Please suggest me the proper steps for the above problem in Hibernate or is it a bug?
 
nimo frey
Ranch Hand
Posts: 580
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

either, use ascii for TM:

returns ™

or

returns ™

or check your database settings of MySQL (maybe set to UTF-8)..

 
Jaggit singh
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still I am not able to identify the problem. Here is my hibernate configuration

<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop> <prop key="hibernate.jdbc.use_getGeneratedKeys">
true
</prop>
<prop key="hibernate.cache.use_query_cache">
false
</prop>
<prop key="hibernate.cache.use_second_level_cache">false</prop>
<prop key="hibernate.query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</prop>
<prop key="hibernate.connection.useUnicode">true</prop>
<prop key="hibernate.connection.characterEncoding">UTF-8</prop>
</props>
</property>

Please suggest the clearcut solution !!!
 
Jaggit singh
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help expecting!!!
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please keep the number of exclamation marks in your posts to the required minimum, possibly avoiding them completely.

Is the DB schema set to use Unicode?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic