58-bug-plugin-fails-to-load-after-upgrading-to-193-on-velocity (#60)

* Moving to previous H2 version that was in 1.9.2 that somehow got downgraded

* Reverting back to Java 8 compile target

* removing minimize on shade for Common

* Clearly something here changed something, cause reverting it this way seems to have fixed it

* Cleaning up code here

---------

Co-authored-by: Dawson <dawson@funkemunky.cc>
This commit is contained in:
Dawson
2025-03-27 10:44:34 -04:00
committed by GitHub
parent 353b7dad78
commit 9cbeed1df3
8 changed files with 28 additions and 30 deletions
@@ -2,7 +2,6 @@ package dev.brighten.antivpn.database.sql.utils;
import com.mysql.cj.jdbc.Driver;
import dev.brighten.antivpn.AntiVPN;
import org.h2.jdbc.JdbcConnection;
import java.io.File;
import java.sql.Connection;
@@ -38,15 +37,15 @@ public class MySQL {
File dataFolder = new File(AntiVPN.getInstance().getPluginFolder(), "databases");
File databaseFile = new File(dataFolder, "database");
try {
conn = new NonClosableConnection(new JdbcConnection("jdbc:h2:file:" +
databaseFile.getAbsolutePath(),
conn = new NonClosableConnection(new org.h2.jdbc.JdbcConnection("jdbc:h2:file:" +
databaseFile.getAbsolutePath(),
new Properties(), AntiVPN.getInstance().getVpnConfig().getUsername(),
AntiVPN.getInstance().getVpnConfig().getPassword(), false));
conn.setAutoCommit(true);
Query.use(conn);
AntiVPN.getInstance().getExecutor().log("Connection to H2 has been established.");
} catch (SQLException ex) {
AntiVPN.getInstance().getExecutor().logException("H2 exception on initialize: " + ex.getMessage(), ex);
AntiVPN.getInstance().getExecutor().logException("H2 exception on initialize", ex);
}
}