title: Java + Mysql UTF8 Problem
body: <p>as the title said, I have a problem between java and mysql</p>
  
  <p>The mysql DB, tables, and columns are utf8_unicode_ci.
  I have an application that took some input from an xml, then compose the query...</p>
  
  <pre><code>public String [] saveField(String xmltag, String lang){     
    NodeList nodo = this.doc.getElementsByTagName(xmltag);
    String [] pos = new String[nodo.getLength()];     
    for (int i = 0 ; i &lt; nodo.getLength() ; i++ ) {
       Node child = nodo.item(i);
       pos[i] =  "INSERT INTO table (id, lang, value) VALUES (" +
          child.getAttributes().getNamedItem("id").getNodeValue().toString() + " , " +
          lang + " , " + 
          "'" + child.getFirstChild().getTextContent() + "'" +
          ");";       
      }   
     return pos;
  }
  </code></pre>
  
  <p>this method return an array of String that contains one or more SQL insert Query... 
  then </p>
  
  <pre><code>Class.forName("com.mysql.jdbc.Driver").newInstance();
  con = DriverManager.getConnection("jdbc:mysql:///dbname", "user", "pass");
  .....
  Statement s; s =
  this.con.createStatement ();
  s.execute(query);
  </code></pre>
  
  <p>both with <code>s.execyte</code> and <code>s.executeUpdate</code> the special characters are stored as ?</p>
  
  <p>so special char are not stored correctly:
  <code>מסירות קצרות</code> is stored as <code>?????????</code></p>
  
  <p><code>Hi!</code> is stored as <code>Hi!</code></p>
  
  <p>Any advice? </p>
  
  <p>Thanks</p>