Home›Java›Mods›MySQL-API for Devs
ModsJava

MySQL-API for Devs

Minecraft Java mod. Download on the author's site.

⬇ Download on Spigot
Attention: This is no prepared statement example, you have to prevent against mysql injection by yourself :)

Some developers have asked me if I could help them with MySQL.
Here is my MySQL API for developers. You can find an example below.

Simply copy the .jar in your server folder and all your plugins are ready for the MySQL API.

Code-Example
Code (Text):
import de.renickbuettner.forDevs.api.mysql.MySQL;

public class Example1 {

    public void useMySQLAPI(){
     
        MySQL con = new MySQL();
     
        con.host = "localhost";
        con.user = "root";
        con.passwort = "root";
        con.database = "minecraft-server";
     
        con.connect();
     
        if(con.countToBoolean("SELECT COUNT(player) FROM Players WHERE playername='sp33dy4ever'"))
            System.out.println("Oh!!! You´ve a sp33dy :o");
     
        con.disconnect();
    }
 
}
 
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

MySQL-API for Devs is a free Minecraft Java mod. Downloaded 855 times (via Spigot). Download it and open it directly in the game.

Explore more