Hello.
I have a MySQL server with character encoding set to latin2.
In my hibernate.cfg.xml I have:
Quote:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">
jdbc:mysql://localhost/WebAppDB?useUnicode=true&characterEncoding=latin2&connectionCollation=latin2_general_ci&characterSetResults=latin2
</property>
<property name="hibernate.connection.characterEncoding" value="latin2" />
<property name="hibernate.connection.charSet" value="latin2" />
<property name="hibernate.connection.username">root</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<mapping resource="dbTables/Czlowiek.hbm.xml"/>
</session-factory>
</hibernate-configuration>
I am not an advance Hibernate user and I was testing my connection with HQL Query. I want to get polish characters and instead of them I got characters like '^' or 'รค'. When i retrive data from mysql command line everything works perfect, so I think there's a problem in my netbeans/hibernate configuration. Any ideas what to change?
best regards !