Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.theTrixxter.mysql;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- import org.bukkit.plugin.Plugin;
- public class MySQL extends database{
- public String user, database, password, port, hostname;
- public MySQL(Plugin plugin, String hostname, String port, String database, String user, String password) {
- super(plugin);
- this.user = user;
- this.database = database;
- this.password = password;
- this.port = port;
- this.hostname = hostname;
- }
- @Override
- public Connection openConnection() throws SQLException,
- ClassNotFoundException{
- if(checkConnection()){
- return con;
- }
- Class.forName("com.mysql.jdbc.Driver");
- con = DriverManager.getConnection("jdbc:mysql://" + this.hostname + ":" + this.port + "/" + this.database, this.user, this.password);
- return con;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement