HomeJavaModsBoneSQLib | Deprecated
BoneSQLib

A simple SQL library that utilizes BoneCP.

Source | Documentation

Tutorial
Start off by creating your variable.

Code (Text):
private Database sql;
Construct your database object. The constructor does not automatically open the database connection.

Code (Text):
sql = new MySQL(Logger.getLogger("Minecraft"),
            "[MyPlugin]",
            "localhost",
            3306,
            "mydatabase",
            "myusername",
            "mypassword");

Next we need to open the connection:

Code (Text):
if (sql.open()) {
    // ...
}

Grab a connection from the connection pool:

Code (Text):
Connection connection = sql.getConnection();
// Do something with connection.

Close connection after finishing statement:

Code (Text):
connection.close();
Installation
  1. Download the jar.
  2. Add the jar to your Java build path.
  3. Tell your users to install BoneSQLib with your plugin.
Do not install from source!
If you install BoneSQLib directly into your plugin, the following bad things will occur:

  1. You cannot run your plugin alongside BoneSQLib.jar plugins. Bukkit will (usually) find the BoneSQLib classes in your plugin first, and block the BoneSQLib.jar dependency.
  2. You cannot run your plugin alongside other plugins using BoneSQLib directly from source. Same issue.
  3. Updating will definitely cause these problems and cause you much pain.
TODO
  1. Implement support for prepared statements
Thanks
I'd like to give thanks to the author of SQLibrary as I designed the library to be similar to SQLibrary. I also used some of his description as the same things apply because of the similarities.
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.

BoneSQLib | Deprecated is a free Minecraft Java mod. Downloaded 424 times (via Spigot). Download it and open it directly in the game.

Explore more