The Answer to Life, the Universe, and Everything

Tuesday, December 23, 2008

SQL Error: 0, SQLState: 08S01

If you see the such a error by using hibernate3, you need the following to avoid it.
JDBCExceptionReporter SQL Error: 0, SQLState: 08S01


In hibernate.cfg.xml, write

<property name="c3p0.min_size">5</property>
<property name="c3p0.max_size">20</property>
<property name="c3p0.timeout">1800</property>
<property name="c3p0.max_statements">50</property>


Then create "c3p0.properties" in your root classpath folder and write
c3p0.testConnectionOnCheckout=true
c3p0.acquireRetryDelay=1000
c3p0.acquireRetryAttempts=1

Wednesday, December 10, 2008

Illegal mix of collations in MySQL

In case for having such a error in mysql using Hibernate or so.

java.sql.SQLException: General error message
from server: "Illegal mix of collations
(utf8_general_ci,COERCIBLE) and
(latin1_swedish_ci,IMPLICIT) for operation '='"


Add the following in my.cnf
[client]
default-character-set = utf8

[mysqld]
skip-character-set-client-handshake
default-character-set=utf8
character-set-server=utf8
init-connect=SET NAMES utf8