Hey Leute,
ich habe zz ein "kleines" Problem mit meiner MySQL Connection:
Mein onEnable Teil.
Meine MySQL openConnection Methode:
Die Daten (host, port, database usw) stimmen alle, trotzdem bekomme ich einen NullPointer beim öffnen der Connection :/
Über Ideen würde ich mich freuen
ich habe zz ein "kleines" Problem mit meiner MySQL Connection:
Code:
@Override
public void onEnable() {
try {
this.sql = new MySQL();
this.sql.openConnection();
sql.queryUpdate("CREATE TABLE IF NOT EXISTS gPetition (id INT AUTO_INCREMENT PRIMARY KEY, open VARCHAR(5), creater VARCHAR(16), world VARCHAR(255), x INT, y INT, z INT, yaw INT, pitch INT, reason VARCHAR(255)");
} catch (Exception e) {
Bukkit.getLogger().info("Failed to start MySQL Service");
Bukkit.getPluginManager().disablePlugin(this);
}
}
Mein onEnable Teil.
Meine MySQL openConnection Methode:
Code:
public Connection openConnection() {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database, this.user, this.password);
this.conn = conn;
return conn;
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
return null;
}
Die Daten (host, port, database usw) stimmen alle, trotzdem bekomme ich einen NullPointer beim öffnen der Connection :/
Über Ideen würde ich mich freuen