Fixes an SQLException related to the fix for #309 (WAL mode argument was regarded as filename)

This commit is contained in:
Rsl1122 2017-10-07 20:02:30 +03:00
parent 0ca5be7e89
commit 5771218857

View File

@ -59,7 +59,14 @@ public class SQLiteDB extends SQLDB {
}
String dbFilePath = new File(plugin.getDataFolder(), dbName + ".db").getAbsolutePath();
Connection connection = DriverManager.getConnection("jdbc:sqlite:" + dbFilePath + "?journal_mode=WAL");
Connection connection;
try {
connection = DriverManager.getConnection("jdbc:sqlite:" + dbFilePath + "?journal_mode=WAL");
} catch (SQLException ignored) {
connection = DriverManager.getConnection("jdbc:sqlite:" + dbFilePath);
Log.info("SQLite WAL mode not supported on this server version, using default. This may or may not affect performance.");
}
connection.setAutoCommit(false);
// connection.