From 5187ce152ae4c521b4b7675c58b7ad83373e65a0 Mon Sep 17 00:00:00 2001 From: DNx5 Date: Sat, 9 Jan 2016 06:19:09 +0700 Subject: [PATCH] Enabled cachePrepStmts properties. --- src/main/java/fr/xephi/authme/datasource/MySQL.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/fr/xephi/authme/datasource/MySQL.java b/src/main/java/fr/xephi/authme/datasource/MySQL.java index 1e81162a3..185898190 100644 --- a/src/main/java/fr/xephi/authme/datasource/MySQL.java +++ b/src/main/java/fr/xephi/authme/datasource/MySQL.java @@ -104,7 +104,12 @@ public class MySQL implements DataSource { ds = new HikariDataSource(); ds.setPoolName("AuthMeMYSQLPool"); ds.setDriverClassName("com.mysql.jdbc.Driver"); - ds.setJdbcUrl("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database + "?rewriteBatchedStatements=true&jdbcCompliantTruncation=false"); + ds.setJdbcUrl("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database); + ds.addDataSourceProperty("rewriteBatchedStatements", "true"); + ds.addDataSourceProperty("jdbcCompliantTruncation", "false"); + ds.addDataSourceProperty("cachePrepStmts", "true"); + ds.addDataSourceProperty("prepStmtCacheSize", "250"); + ds.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); ds.setUsername(this.username); ds.setPassword(this.password); ds.setInitializationFailFast(true); // Don't start the plugin if the database is unavailable