title: connect mysql with java using eclipse
body: <p>i can connect mysql with java using eclipse in a java application with these statements</p>
  
  <pre><code>String unicode = "?useUnicode=yes&amp;characterEncoding=UTF-8";
  Class.forName("com.mysql.jdbc.Driver");
              con = (Connection) DriverManager.getConnection(
                      "jdbc:mysql://localhost:3306/ams-competation" + unicode,
                      username, password);
  </code></pre>
  
  <p>and it works good</p>
  
  <p>but my problem is when i tried to connect to mysql with a server application i got this exception</p>
  
  <p><code>java.lang.ClassNotFoundException: com.mysql.jdbc.Driver</code>
  what am i doing wrong?thank you all</p>
  
  <h1>Edit</h1>
  
  <p>i have added <code>mysql-connector</code> already</p>