title: No suitable driver found for jdbc:mysql//localhost:3306/test
body: <p>I am trying to write a java program connecting to a MySQL database. But I am getting this error:</p>
  
  <blockquote>
    <p>No suitable driver found for jdbc:mysql//localhost:3306/test</p>
  </blockquote>
  
  <p>I have already installed <code>mysql-connector-java.5.1.23-bin.jar</code>. I am still getting this error.</p>
  
  <p>Here is my program:</p>
  
  <pre><code>package database_practice;
  
  import java.sql.*;
  
  public class CreateConnection {
          private Connection conn = null;
  
          public static void main(String args[]) {
              CreateConnection conn = new CreateConnection();
                  conn.getConnection();
          }
  
  
          public Connection getConnection() {
              try {
                  String url = "jdbc:mysql//localhost:3306/test";
                  String username = "root";
                  String password = "admin1234";
  
              Class.forName("com.mysql.jdbc.Driver").newInstance();
              conn = DriverManager.getConnection(url, username, password);
              System.out.println("Database Created...!!!");
          }
  
          catch (Exception e) {
              e.printStackTrace();
              System.out.println("Error occured while connecting to database");
          }
              return conn;
      }
  }
  </code></pre>