ich versuche schon die ganze Zeit, in mein Plugin eine MySQL Schnittstelle reinzumachen. Hier mal die Hauptklasse:
PHP Code:
@Override
public void onEnable(){
System.out.print("Try to connect with MySQL!...");
try {
create_tables();
} catch (SQLException e) {
System.err.println(e.getMessage());
}
}
public void onDisable(){
System.out.print("Shutdown...");
}
public void create_tables() throws SQLException
{
Connection conn = DriverManager.getConnection("jdbc:mysql://*Ersetzt1*:3306/*Ersetzt2*", "*Ersetzt3*", "*Ersetzt4*");
PreparedStatement sampleQueryStatement = conn.prepareStatement("CREATE TABLE users (p_id int NOT NULL AUTO_INCREMENT KEY)");
sampleQueryStatement.executeUpdate();
sampleQueryStatement.close();
conn.close();
}
*Ersetzt2* = Datenbank
*Ersetzt3* = Username
*Ersetzt4* = Passwort
President






