title: Java can't connect to mysql database
body: <p>I want to connect a server to a mysql database.I included the driver library  mysql-connector-java-5.0.8.I installed the mysql connector.I have this code:</p>
  
  <pre><code>    public void connect() throws SQLException, ClassNotFoundException{
  
         String source="jdbc:derby://localhost:3306/security";
         Class.forName("com.mysql.jdbc.Driver");
         Connection con=DriverManager.getConnection(source,"root","");
  </code></pre>
  
  <p>}
  I use xampp for the mysql database.I made a database called security.When i try to execute the connect() method I receive the  </p>
  
  <pre><code>     No suitable driver found for jdbc:derby://localhost:3306/security
  </code></pre>
  
  <p>exception.I searched for hours but I could not find a solution to my problem.This is the entire code I used to try to connect to the database.</p>