Advertisement
Guest User

Untitled

a guest
Feb 17th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. HikariConfig configuration = new HikariConfig();
  2. configuration.setJdbcUrl("jdbc:mysql://127.0.0.1:3306/testdb");
  3. configuration.addDataSourceProperty("serverName","127.0.0.1");
  4. configuration.addDataSourceProperty("port", 3306);
  5. configuration.addDataSourceProperty("databaseName", "testdb"));
  6. configuration.addDataSourceProperty("user", "root");
  7. configuration.addDataSourceProperty("password", "123");
  8. configuration.setDriverClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
  9. this.database = new HikariDataSource(configuration);
  10. return true;
  11.  
  12. [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-0 - is starting.
  13. [main] WARN com.zaxxer.hikari.util.DriverDataSource - Registered driver with driverClassName=org.mariadb.jdbc.MySQLDataSource was not found, trying direct instantiation.
  14. [main] WARN com.zaxxer.hikari.util.DriverDataSource - Could not instantiate instance of driver class org.mariadb.jdbc.MySQLDataSource, trying JDBC URL resolution
  15. java.lang.ClassCastException: org.mariadb.jdbc.MySQLDataSource cannot be cast to java.sql.Driver
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement