Skip to content

Commit 64bab7a

Browse files
authored
fix(mysql-storage): Attempt adding auto-reconnect on mobile
1 parent ae7393a commit 64bab7a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/main/java/com/dre/brewery/storage/impls/MySQLStorage.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,14 @@ public class MySQLStorage extends DataManager {
6969
public MySQLStorage(ConfiguredDataManager record) throws StorageInitException {
7070
super(record.getType());
7171
try {
72-
this.connection = DriverManager.getConnection(URL + record.getAddress(), record.getUsername(), record.getPassword());
72+
String jdbcUrl = URL + record.getAddress()
73+
+ "/" + record.getDatabase()
74+
+ "?autoReconnect=true";
75+
this.connection = DriverManager.getConnection(
76+
jdbcUrl,
77+
record.getUsername(),
78+
record.getPassword()
79+
);
7380
this.tablePrefix = record.getTablePrefix();
7481
this.serializer = new SQLDataSerializer();
7582
} catch (SQLException e) {

0 commit comments

Comments
 (0)