title: Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql://localhost:3306/web13?useSSL=false&serverTimezone=UTC'
body: <p>I created a properties file</p>
  
  <pre><code>url=jdbc:mysql://localhost:3306/web13?useSSL=false&amp;serverTimezone=UTC
  username=root
  password=root
  </code></pre>
  
  <p>and I created a connection pool</p>
  
  <pre><code>    private static DataSource dataSource; 
  static {
  
      try {
          //load properties file
          InputStream is = DBCPUtils.class.getClassLoader().getResourceAsStream("db.properties");
          //load input stream
          Properties props = new Properties();
          props.load(is);
          //create data source
          dataSource = BasicDataSourceFactory.createDataSource(props);
      } catch (Exception e) {
          // TODO Auto-generated catch block
          throw new RuntimeException(e);
      }
  }
  </code></pre>
  
  <p>Then I got the problem. I searched some anwsers, they said driver needs to be registered like Class.forName(com.mysql.jdbc.Driver). But my version of driver seems to be able to register by itself, so this solution can not work.</p>
  
  <p><strong>Error</strong>:</p>
  
  <blockquote>
    <p>Oct 02, 2018 9:46:09 AM org.apache.catalina.core.StandardContext
    reload INFO: Reloading Context with name [/WEB13] is completed</p>
    
    <p>java.sql.SQLException: Cannot create JDBC driver of class '' for
    connect URL
    'jdbc:mysql://localhost:3306/web13?useSSL=false&amp;serverTimezone=UTC'
      at
    org.apache.commons.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2224)
      at
    org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2104)
      at
    org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1563)
      at
    org.apache.commons.dbutils.AbstractQueryRunner.prepareConnection(AbstractQueryRunner.java:319)
      at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:327)
      at com.itheima.login.LoginServlet.doGet(LoginServlet.java:36)   at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:634)  at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:741)  at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
      at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      at
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
      at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
      at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      at
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
      at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
      at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      at
    org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
      at
    org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      at
    org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770)
      at
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
      at
    org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:748) Caused by:
    java.sql.SQLException: No suitable driver     at
    java.sql.DriverManager.getDriver(DriverManager.java:315)  at
    org.apache.commons.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2209)
      ... 29 more</p>
  </blockquote>