Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.frog.sql;
- public class Core extends JavaPlugin {
- public static MySQL mysql;
- private static Connection connection;
- public void onEnable() {
- //format: new MySQL(port, user, password, database);
- mysql = new MySQL("localhost", "root", "password", "nick69");
- }
- public MySQL(String ip, String userName, String password, String db) {
- try {
- Class.forName("com.mysql.jdbc.Driver");
- connection = DriverManager.getConnection("jdbc:mysql://" + ip + "/" + db + "?user=" + userName + "&password=" + password);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
Add Comment
Please, Sign In to add comment