Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't for the life of me get this to work #789

Closed
incrementing opened this issue Dec 22, 2016 · 4 comments
Closed

I can't for the life of me get this to work #789

incrementing opened this issue Dec 22, 2016 · 4 comments

Comments

@incrementing
Copy link

incrementing commented Dec 22, 2016

Version: 2.5.1

When using this code:
hikari = new HikariDataSource(); hikari.setMaximumPoolSize(10); hikari.setDriverClassName("com.mysql.jdbc.Driver"); hikari.setJdbcUrl("jdbc:mysql://localhost:3306/db_name"); hikari.setUsername("root"); hikari.setPassword("password");

I get this error:
INFO com.zaxxer.hikari.HikariDataSource - HikariPool-6 - Started.
INFO com.zaxxer.hikari.pool.PoolBase - HikariPool-6 - Driver does not support get/set
network timeout for connections. (com.mysql.jdbc.JDBC4Connection.getNetworkTimeout()I)>

So I then used this code:
hikari = new HikariDataSource(); hikari.setMaximumPoolSize(10); hikari.setDataSourceClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource"); hikari.addDataSourceProperty("serverName", "localhost"); hikari.addDataSourceProperty("port", "3306"); hikari.addDataSourceProperty("databaseName", "db_name"); hikari.addDataSourceProperty("user", "root"); hikari.addDataSourceProperty("password", "password");

Which throws the same error.

This code used to work for me but for some reason I can't get it to work anymroe. I'm probably being an idiot but any help would be appreciated.

@shakuzen
Copy link
Contributor

As the log message indicates, the MySQL driver you are using does not support setting the network timeout. Perhaps a newer version of the driver does.

@incrementing
Copy link
Author

incrementing commented Dec 22, 2016

Using org.mariadb.jdbc.MySQLDataSource now but It gives me a ClassNotFoundException despite the fact I've got mariadb-java-client as a maven dependency.

@brettwooldridge
Copy link
Owner

@incrementing The Driver does not support get/set network timeout message is informational, it does not affect basic pool functionality (but does affect recovery from network outages).

@incrementing
Copy link
Author

@brettwooldridge Thanks for the info... I'll have to update the driver at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants