title: No Suitable Driver Found. Java JDBC mysql connector
body: <p>Here is my code:</p>
  
  <pre><code>import java.sql.*;
  import com.mysql.jdbc.Driver;
  
  public class Main {
  
      public void connect() {
          Connection con = null;
  
  
          try {
              Class.forName("com.mysql.jdbc.Driver");
              con = DriverManager.getConnection("jdbc:mysql//localhost:3306/mydb", "dev", "pass");
          }
          catch (Exception e) {
              e.printStackTrace();
          }
          finally {
              if (con != null) try { con.close(); } catch(Exception e) {}
          }
      }
  
      public static void main(String[] args) {
          Main m = new Main();
  
          m.connect();
      }
  }
  </code></pre>
  
  <p>I have imported mysql-connector-java-5.1.39.jar as a library in IntelliJ and as you can see the driver is imported in the code.</p>
  
  <p>But I get:</p>
  
  <pre><code>java.sql.SQLException: No suitable driver found for jdbc:mysql//localhost:3306/mydb
  </code></pre>
  
  <p>I have looked at countless stack overflow questions and I can't figure out what more it needs to at least attempt a connection. I have a local SQL server running, and I've double checked the port and database name.</p>
  
  <p>Any ideas would be appreciated, thanks.</p>
  
  <p>EDIT: this is not a duplicate. The solution to the other question that someone flagged is not relevant here. I had already added the jar as a library for the project, as described in the other question. Also, the crash doesn't happen on the "Class.forName" part, it crashes on the subsequent line.</p>