Fixing sql errors and fixing NPE of missing VpnStrings

This commit is contained in:
funkemunky
2021-09-09 15:09:02 -04:00
parent c1ef2eef56
commit b573fca58b
3 changed files with 17 additions and 4 deletions
@@ -173,7 +173,7 @@ public class MySqlVPN implements VPNDatabase {
//We want to make sure there isn't already a uuid inserted to prevent double insertions
alertsState(uuid, alreadyEnabled -> { //No need to make another thread execute, already async
if(!alreadyEnabled) {
Query.prepare("insert into `alerts` (`uuid`) values ?").append(uuid.toString())
Query.prepare("insert into `alerts` (`uuid`) values (?)").append(uuid.toString())
.execute();
} //No need to insert again of already enabled
});
@@ -200,8 +200,8 @@ public class MySqlVPN implements VPNDatabase {
if(set.getObject("DATA_TYPE").toString().contains("varchar")) {
System.out.println("Using old database format for storing responses! " +
"Dropping table and creating a new one...");
if(Query.prepare("drop table `responses`").execute() == 1) {
System.out.println("Sucessfully dropped table!");
if(Query.prepare("drop table `responses`").execute() > 0) {
System.out.println("Successfully dropped table!");
}
}
});