2 Replies Latest reply on Aug 12, 2003 4:50 AM by IPOz

    Setting characterEncoding to connect Mysql

    Ritchie Koh Newbie

      Dear all.

      I'm trying to connecting to the Mysql 4.x with characterset.

      mysql-ds.xml is following.
      --------------------------------------

      <local-tx-datasource>
      <jndi-name>MySqlDS</jndi-name>
      <connection-url>jdbc:mysql://127.0.0.1:3306/db_empty11?useUnicode=true;characterEncoding=euc-kr</connection-url>
      <driver-class>org.gjt.mm.mysql.Driver</driver-class>
      <user-name>root</user-name>

      </local-tx-datasource>


      ---------------------------------

      But there is no charactor encoding in the Mysql.
      I can not read korean character.

      Please let me know setting the characterEncoding to connect Mysql.

      Thanks.

      Regards

      # Ritchie

        • 1. Re: Setting characterEncoding to connect Mysql
          cbzhou Newbie

          Hi there,

          I'm just new both to jboss and mysql :), Assuming you're familiar with the jdbc url, then I wonder whether the unavailable euc-kr due to your syntax error of your jdbc url?

          original url:
          <connection-url>jdbc:mysql://127.0.0.1:3306/db_empty11?useUnicode=true;characterEncoding=euc-kr</connection-url>

          which use the semicolon to seperate the paramenter list, should we use ampersand instead? like:
          <connection-url>jdbc:mysql://127.0.0.1:3306/db_empty11?useUnicode=true & characterEncoding=euc-kr</connection-url>

          good luck.


          • 2. Re: Setting characterEncoding to connect Mysql
            IPOz Newbie

            In xml '&' should be "&amp;",right ?



            <local-tx-datasource>
            <jndi-name>jdbc/OmnetDemo</jndi-name>
            <connection-url>jdbc:mysql://127.0.0.1:3306/demo?useUnicode=true&amp;characterEncoding=GBK</connection-url>
            <driver-class>com.mysql.jdbc.Driver</driver-class>
            <user-name>root</user-name>
            omnet123
            <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
            </local-tx-datasource>