Archived
0

перенос настроек базы даный в конфиг

This commit is contained in:
2019-02-24 16:09:49 +03:00
parent 8a695ae909
commit d045a84d4c
2 changed files with 11 additions and 3 deletions

View File

@@ -37,10 +37,14 @@ public class PrisonAPI extends JavaPlugin {
public static Connection CONN; public static Connection CONN;
public void onEnable() { public void onEnable() {
saveDefaultConfig();
final String dbUrl = getConfig().getString("database.url");
final String dbUser = getConfig().getString("database.user");
final String dbPasswd = getConfig().getString("database.password");
try { try {
CONN = DriverManager.getConnection( CONN = DriverManager.getConnection(dbUrl, dbUser, dbPasswd);
"jdbc:mysql://localhost:3306/prison4life",
"root", "root");
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@@ -0,0 +1,4 @@
database:
url: jdbc:mysql://localhost:3306/prison4life
user: root
password: root