title: java.sql.SQLException: No suitable driver found for CONNECTION_URL
body: <p>i m getting error </p>
  
  <blockquote>
    <p>java.sql.SQLException: No suitable driver found for CONNECTION_URL</p>
  </blockquote>
  
  <p>This is a connection provider java file.</p>
  
  <pre><code>   package login;
      import java.sql.*;
      import java.sql.SQLException;
  
      public class ConnectionProvider {
      static Connection con = null;
      String database = "game";
      String CONNECTION_URL = "jdbc:mysql://localhost:3306/" + database;
      String USERNAME = "root";
      String PASSWORD = "";
  
      static {
          try {
              Class.forName("com.mysql.jdbc.Driver");
              con = DriverManager.getConnection("CONNECTION_URL", "USERNAME", "PASSWORD");
              Statement stmt = con.createStatement();
  
          } catch (SQLException sqle) {
              System.out.println("SQLException: Unable to open connection to db: "+sqle.getMessage());
              try {
                  throw sqle;
              } catch (SQLException e) {
                  e.printStackTrace();
              }
          } catch(Exception e) {
              System.out.println("Exception: Unable to open connection to db: "+e.getMessage());
              try {
                  throw e;
              } catch (ClassNotFoundException e1) {
                  e1.printStackTrace();
              }
          }
      }
  }
  </code></pre>
  
  <p>Im using navicat, mysql and tomcat sv. I'm pretty sure they are running. This is the log from IntelliJ.</p>
  
  <pre><code>SQLException: Unable to open connection to db: No suitable driver found for CONNECTION_URL
  java.sql.SQLException: No suitable driver found for CONNECTION_URL
      at java.sql.DriverManager.getConnection(DriverManager.java:689)
      at java.sql.DriverManager.getConnection(DriverManager.java:247)
      at login.ConnectionProvider.&lt;clinit&gt;(ConnectionProvider.java:18)
      at login.loginDAO.validate(loginDAO.java:21)
      at login.loginDAO.doPost(loginDAO.java:56)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2463)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2452)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>thank you for your help</p>