Deutsch
Dieses Plugin ist eine MySQL-API. Alle Updates und Anfragen laufen asynchron unter dem Methoden-Aufruf update , query und getValue .
Das Plugin soll Einsteigern helfen, die sich erst mit MySQL beschäftigen. Es ist nicht groß, aber dennoch für Einsteiger sehr nützlich. Der Source-Code steht offen zur Verfügung. Jeder kann die beiden Klassen downloaden und in das eigene Projekt importieren oder das Projekt, sei es per Maven oder sei es per Libraries-Import, hinzufügen.
English
This plugin is an API for MySQL. All updates and requests run asynchronously if you call the methods update , query or getValue .
The plugin is designed to help people who are learning MySQL. It's not big, but it's very useful for beginners. The source code is open. Anyone can download the two classes and import them into their own project or add the project, whether by Maven or by Libraries import.
Developer-Example
import me.phil.mysql.api.database.DataBaseManager ;
import me.phil.mysql.api.MySQLAPI ;
public class DataBaseManagerExample {
public void example ( ) {
DataBaseManager dataBaseManager = new DataBaseManager (
"localhost" ,
3306 ,
"database" ,
"username" ,
"password" ) ; // Create an instance.
dataBaseManager. getHost ( ) ; // Returns the IP.
dataBaseManager. getPort ( ) ; // Returns the port.
dataBaseManager. getDatabase ( ) ; // Returns the database-name.
dataBaseManager. getUsername ( ) ; // Returns the username.
dataBaseManager. getPassword ( ) ; // Returns the password.
dataBaseManager. getConnection ( ) ; // Returns the connection if database is connected, null if not.
dataBaseManager. createTable ( "info" , "uuid VARCHAR(64), example VARCHAR(16)" ) ; // Creates an table with columns.
dataBaseManager. connect ( ) ; // Connect to an database.
dataBaseManager. connect ( ( ) -> {
// Put your code here!
// for e.g.: System.out.println("Connected!");
} ) ; // Connect to an database and execute your code.
dataBaseManager. disconnect ( ) ; // Disconnect to an database.
dataBaseManager. disconnect ( ( ) -> {
// Put your code here!
// for e.g.: System.out.println("Disconnected!");
} ) ; // Disconnect to an database and execute your code.
dataBaseManager. update ( "INSERT INTO info(name, example) VALUES ('xLikePhil', 'otherexample')" ) ; // Update an query asynchronous.
dataBaseManager. query ( "SELECT * FROM info WHERE example = 'xLikePhil';" , resultSet -> {
// Put your code here!
// for e.g.: System.out.println(resultSet.next());
} ) ; // Update an query and return ResultSet asynchronous and execute your code.
dataBaseManager. isConnected ( ) ; // Return if database is connected.
dataBaseManager. getValue ( "info" , "name" , "xLikePhil" , "example" , object -> {
/*
Put your code here!
for e.g.:
String example = (String) object;
Bukkit.getPlayer("xLikePhil").sendMessage("Your example: " + example);
*/
} ) ; // Return an value from database asynchronous and execute your code.
public void otherExample ( ) {
MySQLAPI. getConnections ( ) ; // Return all connections.
MySQLAPI. getPlugin ( MySQLAPI. class ) ; // Return JavaPlugin of the class.
MySQLAPI. getProvidingPlugin ( MySQLAPI. class ) ; // Return the instance of the class.
}
}Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta