T
TheWarZ-Network
Guest
Guten Abend,
Ich habe ein Problem mit MySQL. Ich bekomme eine NullPointerException, welche mich auf folgende Klasse verweist:
Die Verbindung zur Datenbank ist bereits hergestellt.
Danke für alle Antworten!
Ich habe ein Problem mit MySQL. Ich bekomme eine NullPointerException, welche mich auf folgende Klasse verweist:
Code:
package de.thewarz.lobby.commands;
import java.sql.SQLException;
import java.sql.Statement;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import de.thewarz.lobby.MySQL;
public class CMD_mysqltest implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(cmd.getName().equals("mysqltest")){
Statement st = null;
try {
st = MySQL.getConnection().createStatement();
st.executeUpdate("CREATE TABLE coins (uuid VARCHAR(20), coins VARCHAR(10000000))");
} catch (SQLException e) {
e.printStackTrace();
}
}
return false;
}
}
Danke für alle Antworten!