Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String username;
- public static String password;
- public static String database;
- public static String host;
- public static String port;
- public static Connection con;
- private static File getMySQLFile(){
- return new File("plugins/PandoraSpigot", "mysql.cfg");
- }
- private static FileConfiguration getMySQLConfig(){
- return YamlConfiguration.loadConfiguration(getMySQLFile());
- }
- public static void setStandardMySQLFile(){
- FileConfiguration cfg = getMySQLConfig();
- cfg.options().copyDefaults(true);
- cfg.addDefault("username", "benutzername");
- cfg.addDefault("password", "passwort");
- cfg.addDefault("database", "datenbank");
- cfg.addDefault("host", "localost");
- cfg.addDefault("port", "3306");
- try {
- cfg.save(getMySQLFile());
- }catch (IOException e){
- e.printStackTrace();
- }
- }
- public static void readMySQLFile(){
- FileConfiguration cfg = getMySQLConfig();
- MySQL.username = cfg.getString("username");
- MySQL.password = cfg.getString("password");
- MySQL.password = cfg.getString("database");
- MySQL.password = cfg.getString("host");
- MySQL.password = cfg.getString("port");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement