Sueta

JewellsCP

1.4.5

SQL DataBases API

·Plugin

¡Hey there!
This API provide a set of methods, some of them are:
- The possibility of create a set of connections to a database.
- Manage these connections.
- Make queries.
- Query data of other plugins and listen this queries.

Create a set of connections for you plugin and make a query using it:

public class YourPluginMainClass extends JavaPlugin {

public void onEnable() {
//PluginConnection(plugin, databaseEngine, host, port, databaseName, username, password);
PluginConnection connection = new PluginConnection(this, Engine.MYSQL, "localhost", 3306, "anotherDB", "joshy", "12345");

//query(SQLInstruction, values[]);
ResultSet resultSet = connection.query("insert into MyGuests (name, surname, email) values (?, ?, ?)", new Object[]{"will", "smith", "[email protected]"});
}

Obtain a PluginConnection of a plugin using the PluginConnectionManager:

PluginConnectionManager.getInstance().getConnections().getKey(JavaPlugin plugin);

Repository:

<repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
</repository>

Artifact:

<dependency>
       <groupId>com.github.joshy56</groupId>
       <artifactId>JewellsCP</artifactId>
       <version>1.4.5</version>
</dependency>

Similar projects

Plugin →