correct error handling of no db and mqtt connection.

This commit is contained in:
lukas-heiligenbrunner
2020-04-15 16:53:58 +02:00
parent cf9069e489
commit 14eea02dcf
7 changed files with 58 additions and 31 deletions

View File

@ -82,7 +82,14 @@ public class JDBC {
throw new IOException("No connection to database");
// todo reconnect every 5mins or something
}
}
public void disconnect(){
try {
conn.close();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
}
/**
@ -114,7 +121,7 @@ public class JDBC {
return stmt.executeUpdate();
}
public boolean isConnected() {
public static boolean isConnected() {
return loggedin;
}
}