1 Reply Latest reply on Jul 11, 2003 2:33 AM by fbiaggi

    Char Encoding Problem with MySQL

    kuffc

      Hi all,

      I'm using JBoss 3.2.1 and MySQL 3.23.52.

      I have problems to store german and french special chars (umlauts, accented characters) in my mysql db. When I'm using such chars, only some goofy characters are stored in the db.
      There is absolutely no problem with this, when I'm using a normal jdbc connection.

      I guess, that this is a char encoding problem. So I tried to set the right character encoding (ISO-8859-1) connection property. But it did not help.

      mysql-ds.xml:
      ==========

      <local-tx-datasource>
      <jndi-name>MySqlDS</jndi-name>
      <connection-url>jdbc:mysql://127.0.0.1:3306/jbossdb</connection-url>
      <driver-class>org.gjt.mm.mysql.Driver</driver-class>
      <user-name>mysql</user-name>
      *****
      <connection-property name="char.encoding">ISO-8859-1</connection-property>
      </local-tx-datasource>


      ======

      I hope someone can help me.

        • 1. Re: Char Encoding Problem with MySQL
          fbiaggi

          Hi,
          migrate to MySQL 4.0.13 and the latest stable JDBC driver.
          In the connection URL specify:
          <connection-url>jdbc:mysql://127.0.0.1:3306/mxDb?autoReconnect=true&amp;useUnicode=true</connection-url>

          This solved the problem in our cases.
          Ciao.