Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Get config from Config in plugin
- String type =plugin.getConfig().getString(CONFIG_DATABASE_TYPE);
- this.host = (String) plugin.getConfig().getString(CONFIG_DATABASE_IP);
- this.port = String.valueOf(plugin.getConfig().getString(CONFIG_DATABASE_PORT));
- this.username = (String) plugin.getConfig().getString(CONFIG_DATABASE_USER_NAME);
- this.password = (String) plugin.getConfig().getString(CONFIG_DATABASE_PASSWORD);
- String name = (String) plugin.getConfig().getString(CONFIG_DATABASE_NAME);
- this.prefix = (String) plugin.getConfig().getString(CONFIG_DATABASE_PREFIX);
- if (plugin.getConfig().getString(CONFIG_DATABASE_TYPE).toUpperCase().equals("MYSQL")) {
- dbUrl = "jdbc:mysql://" + this.host + ":" + this.port + "/" + name;
- } else if (plugin.getConfig().getString(CONFIG_DATABASE_TYPE).toUpperCase().equals("SQLITE")) {
- dbUrl = "jdbc:sqlite:" + "plugins/PayDay/" + name + ".db";
- } else {
- plugin.getLogger().error("DATABASE CONFIGURATION MISSING");
- }
Add Comment
Please, Sign In to add comment