title: Can't cast MySQLDataSource to java.sql.driver
body: <p>In this Java project, I wanted to try working with HikariCP for one, see if I would like it.</p>
  
  <p>It seems very simple at first, but when I actually try to run my application, it goes wrong. The following code is a function in my <code>DatabasePool.java</code></p>
  
  <pre><code>    HikariConfig configuration = new HikariConfig();
      configuration.setJdbcUrl("jdbc:mysql://127.0.0.1:3306/testdb");
      configuration.addDataSourceProperty("serverName","127.0.0.1");
      configuration.addDataSourceProperty("port", 3306);
      configuration.addDataSourceProperty("databaseName", "testdb"));
      configuration.addDataSourceProperty("user", "root");
      configuration.addDataSourceProperty("password", "123");
      configuration.setDriverClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
      this.database = new HikariDataSource(configuration);
      return true;
  </code></pre>
  
  <p>And for some reason, when this gets ran, I get the following error back:</p>
  
  <pre><code>[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-0 - is starting.
  [main] WARN com.zaxxer.hikari.util.DriverDataSource - Registered driver with driverClassName=org.mariadb.jdbc.MySQLDataSource was not found, trying direct instantiation.
  [main] WARN com.zaxxer.hikari.util.DriverDataSource - Could not instantiate instance of driver class org.mariadb.jdbc.MySQLDataSource, trying JDBC URL resolution
  java.lang.ClassCastException: org.mariadb.jdbc.MySQLDataSource cannot be cast to java.sql.Driver
  </code></pre>
  
  <p>I checked if the class exists in my project, it does. I can't really think of a cause for this.</p>
  
  <p>I'm new to pretty new to Java, so I have no idea if I supplied enough information in the question. Please state it if that's not the case.</p>