fixed database name problem

This commit is contained in:
Louis Vallat 2020-04-06 21:00:09 +02:00
parent 993279974b
commit 1a76a0d78f

View File

@ -12,6 +12,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
import java.sql.*; import java.sql.*;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
@ -78,7 +79,7 @@ public class BackHome extends JavaPlugin implements Listener, TabCompleter {
* @throws SQLException if the connection couldn't be established. * @throws SQLException if the connection couldn't be established.
*/ */
private Connection getConnection() throws SQLException { private Connection getConnection() throws SQLException {
return DriverManager.getConnection("jdbc:sqlite:" return DriverManager.getConnection("jdbc:sqlite:" + getDataFolder() + File.separator
+ getConfig().getString(DB_NAME_KEY)); + getConfig().getString(DB_NAME_KEY));
} }