title: Setting the mysql collation correctly
body: <p>I'm trying to insert to my table hebrew values but the result is always "??????".
  Which collation should I use?I tried to use hebrew_bin and hebrew_general_ci and the result was the same.
  The reason I used the Java tag is that my code is written in java and as far as I know in web development you have to specify the collation in the web scripts also.
  So maybe I have to do that in the java code also?</p>
  
  <p><strong>EDIT</strong>
  Here is the code:</p>
  
  <pre><code>private String url = "jdbc:mysql://ip:port/";
  private String dbName = "dbname";
  private String driver = "com.mysql.jdbc.Driver";
  private String userName = "user"; 
  private String password = "password";
  </code></pre>
  
  <p>....</p>
  
  <pre><code>stmt = conn.prepareStatement("INSERT INTO locations(location) VALUES (?)");
                      stmt.setString(1, "hebrew sentence");
                      stmt.execute();
  </code></pre>
  
  <p>Now how do I change my code into the example you showed?</p>