title: java.sql.SQLException: No suitable driver found for jdbc://localhost:3306/twitch
body: <p>I was trying to connect to MySQL &quot;twitch&quot; database using java with this code below:</p>
  <pre><code>import java.sql.*;
  
  public class App {
      public static void main(String[] args) throws Exception {
          try {
              Class.forName(&quot;com.mysql.jdbc.Driver&quot;);
              //Class.forName(&quot;com.mysql.cj.jdbc.Driver&quot;);
  
              String url = &quot;jdbc://localhost:3306/twitch&quot;;
              String username = &quot;root&quot;;
              String pass = &quot;nfreal-yt10&quot;;
  
              Connection con=DriverManager.getConnection(url,username,pass);
              Statement stmt=con.createStatement();
              ResultSet rs=stmt.executeQuery(&quot;select distinct creator_id from twitch.information where creator_id &gt; 40;&quot;);
              while (rs.next()) {
                  System.out.println(rs.getString(1));
              }
              con.close();
          }
          catch(Exception e) {
              System.out.println(e);
          }
      }
  }
  </code></pre>
  <p>when I executed the code my console throws (Full error):</p>
  <pre><code>Loading class `com.mysql.jdbc.Driver'. 
  This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver 
  class is generally unnecessary.        
  java.sql.SQLException: No suitable driver found for jdbc://localhost:3306/twitch
  </code></pre>
  <p>I have added MySQL connector on my directory folder and all stuff which required to be added, yet the error still occurred, why?</p>