other parameters
This commit is contained in:
parent
c3ed771939
commit
939462786f
1
.idea/dictionaries/Gabriele.xml
generated
1
.idea/dictionaries/Gabriele.xml
generated
@ -30,6 +30,7 @@
|
|||||||
<w>getclasse</w>
|
<w>getclasse</w>
|
||||||
<w>hashpw</w>
|
<w>hashpw</w>
|
||||||
<w>hashsum</w>
|
<w>hashsum</w>
|
||||||
|
<w>hikari</w>
|
||||||
<w>hotbar</w>
|
<w>hotbar</w>
|
||||||
<w>irobin</w>
|
<w>irobin</w>
|
||||||
<w>jdbc</w>
|
<w>jdbc</w>
|
||||||
|
|||||||
@ -108,22 +108,24 @@ public class MySQL implements DataSource {
|
|||||||
private synchronized void setConnectionArguments()
|
private synchronized void setConnectionArguments()
|
||||||
throws IllegalArgumentException {
|
throws IllegalArgumentException {
|
||||||
HikariConfig config = new HikariConfig();
|
HikariConfig config = new HikariConfig();
|
||||||
Properties mySqlProps = new Properties();
|
|
||||||
mySqlProps.setProperty("useConfigs", "maxPerformance");
|
config.setPoolName("AuthMe-ConnectionPool");
|
||||||
config.setDriverClassName("com.mysql.jdbc.Driver");
|
config.setDriverClassName("com.mysql.jdbc.Driver");
|
||||||
config.setJdbcUrl("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database);
|
config.setJdbcUrl("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database);
|
||||||
config.setUsername(this.username);
|
config.setUsername(this.username);
|
||||||
config.setPassword(this.password);
|
config.setPassword(this.password);
|
||||||
config.setMaximumPoolSize((Runtime.getRuntime().availableProcessors() * 2) + 1);
|
|
||||||
|
Properties mySqlProps = new Properties();
|
||||||
|
mySqlProps.setProperty("useConfigs", "maxPerformance");
|
||||||
|
mySqlProps.setProperty("useUnicode", "true");
|
||||||
|
mySqlProps.setProperty("characterEncoding", "utf-8");
|
||||||
|
mySqlProps.setProperty("rewriteBatchedStatements", "true");
|
||||||
|
mySqlProps.setProperty("cachePrepStmts", "true");
|
||||||
|
mySqlProps.setProperty("prepStmtCacheSize", "250");
|
||||||
|
mySqlProps.setProperty("prepStmtCacheSqlLimit", "2048");
|
||||||
config.setDataSourceProperties(mySqlProps);
|
config.setDataSourceProperties(mySqlProps);
|
||||||
//config.setPoolName("AuthMeMYSQLPool");
|
config.setMaximumPoolSize((Runtime.getRuntime().availableProcessors() * 2) + 1);
|
||||||
//config.addDataSourceProperty("cachePrepStmts", "false");
|
|
||||||
//config.addDataSourceProperty("autoReconnect", false);
|
|
||||||
//config.setInitializationFailFast(true); // Don't start the plugin if the database is unavailable
|
|
||||||
//config.setMaxLifetime(180000); // 3 Min
|
|
||||||
//config.setIdleTimeout(60000); // 1 Min
|
|
||||||
//config.setMinimumIdle(2);
|
|
||||||
//config.setMaximumPoolSize(maxConnections);
|
|
||||||
ds = new HikariDataSource(config);
|
ds = new HikariDataSource(config);
|
||||||
ConsoleLogger.info("Connection arguments loaded, Hikari ConnectionPool ready!");
|
ConsoleLogger.info("Connection arguments loaded, Hikari ConnectionPool ready!");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user