Add autoReconnect=true to MySQL connection URL
This commit is contained in:
parent
1deaa47d95
commit
b65c72bbe3
1 changed files with 1 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ public class SqlUtils {
|
|||
} else {
|
||||
port = 3306;
|
||||
}
|
||||
return DriverManager.getConnection("jdbc:mysql://" + encodeUrlValue(address) + ':' + port + '/' + encodeUrlValue(dbname) + "?useSSL=" + ssl, username, password);
|
||||
return DriverManager.getConnection("jdbc:mysql://" + encodeUrlValue(address) + ':' + port + '/' + encodeUrlValue(dbname) + "?useSSL=" + ssl + "&autoReconnect=true", username, password);
|
||||
} catch (SQLException | UnsupportedEncodingException e) {
|
||||
throw new SqlException(e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue