mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 09:06:46 +01:00
Added autoReconnect props to database to resolve stale connection problems
This commit is contained in:
parent
3bc317e7b2
commit
0a8a843f6e
@ -38,7 +38,10 @@ public class Database {
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
System.out.println("[mcMMO] Attempting connection to MySQL...");
|
System.out.println("[mcMMO] Attempting connection to MySQL...");
|
||||||
conn = DriverManager.getConnection(connectionString);
|
java.util.Properties conProperties = new java.util.Properties();
|
||||||
|
conProperties.put("autoReconnect", "true");
|
||||||
|
conProperties.put("maxReconnects", "3");
|
||||||
|
conn = DriverManager.getConnection(connectionString, conProperties);
|
||||||
isConnected = true;
|
isConnected = true;
|
||||||
System.out.println("[mcMMO] Connection to MySQL established!");
|
System.out.println("[mcMMO] Connection to MySQL established!");
|
||||||
} catch (SQLException ex)
|
} catch (SQLException ex)
|
||||||
|
Loading…
Reference in New Issue
Block a user