title: Hibernate Unicode by netbeans; Why saved in db as "?????"
body: <p>I have a problem like <a href="https://stackoverflow.com/questions/2604588/why-do-unicode-characters-show-up-properly-in-database-but-as-when-printed-in">this post</a>. I am using netbeans 7.01 IDE and MySQL 5.2.35. I used this tricks but not effective:
  I added this properties in my config file:</p>
  
  <pre><code>&lt;property name="hibernate.connection.useUnicode"&gt;true&lt;/property&gt;
  &lt;property name="hibernate.connection.characterEncoding"&gt;UTF-8&lt;/property&gt;
  </code></pre>
  
  <p>and also:</p>
  
  <blockquote>
    <p>jdbc:mysql://localhost:3307/MY_DB_NAME?useUnicode=true&amp;characterEncoding=UTF-8</p>
  </blockquote>
  
  <p>but not effective!</p>
  
  <p>also I tried this java code to make java String Unicode and also it is futile:</p>
  
  <pre><code>    public static String toUTF8(String isoString) {
      String utf8String = null;
      if (null != isoString &amp;&amp; !isoString.equals("")) {
          try {
              byte[] stringBytesISO = isoString.getBytes("ISO-8859-1");
              utf8String = new String(stringBytesISO, "UTF-8");
          } catch (UnsupportedEncodingException e) {
              System.out.println("UnsupportedEncodingException is: " + e.getMessage());
              utf8String = isoString;
          }
      } else {
          utf8String = isoString;
      }
      return utf8String;
  }
  </code></pre>
  
  <p>Can any one help me ?!</p>