Set utf-8 encoding for MySQL connections

Fixes Xephi/AuthMeReloaded#458
This commit is contained in:
games647 2016-01-19 14:31:29 +01:00
parent dd03045bab
commit 0aa6f753be

View File

@ -110,6 +110,12 @@ public class MySQL implements DataSource {
ds.addDataSourceProperty("cachePrepStmts", "true");
ds.addDataSourceProperty("prepStmtCacheSize", "250");
ds.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
//set utf-8 as default encoding
ds.addDataSourceProperty("characterEncoding", "utf8");
ds.addDataSourceProperty("encoding","UTF-8");
ds.addDataSourceProperty("useUnicode", "true");
ds.setUsername(this.username);
ds.setPassword(this.password);
ds.setInitializationFailFast(true); // Don't start the plugin if the database is unavailable