1.1 KiB
1.1 KiB
CreeperSQL Lite
Standalone Java MySQL library for Minecraft plugins. No Bukkit/Spigot. Super light.
Features
- Pure Java
- Automatic config:
plugins/MySQLConnection/config.yml - Standard SQL: SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, DROP TABLE
- Must set config or read before connecting
- Simple API
Usage
- Set config
CreeperSQL mysql = new CreeperSQL();
mysql.setConfig("host","user","pass","db");
or
mysql.readMinecraftConfig();
-
Connect
mysql.connect(); -
SQL actions
getTables()→ list of tablessqlAction(sql)→ returns QueryResultcreateTable(sql)dropTable(name)insert(sql)update(sql)delete(sql)close()
- QueryResult
rows→ list of rowsaffectedRows→ number of rows affectederror→ error messagehasError()→ true if errorhasRows()→ true if rows returned
Build
- Create Java project (SDK 17+)
- Add
CreeperSQL.java - Add MySQL Connector/J
- Build JAR → import into plugin
Notes
- Config must be set/read before connecting
- Async queries recommended for heavy SQL