Class MySQLConnector
java.lang.Object
dev.esophose.playerparticles.database.MySQLConnector
- All Implemented Interfaces:
DatabaseConnector
public class MySQLConnector extends java.lang.Object implements DatabaseConnector
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.esophose.playerparticles.database.DatabaseConnector
DatabaseConnector.ConnectionCallback
-
Constructor Summary
Constructors Constructor Description MySQLConnector(org.bukkit.plugin.Plugin plugin, java.lang.String hostname, int port, java.lang.String database, java.lang.String username, java.lang.String password, boolean useSSL)
-
Method Summary
Modifier and Type Method Description void
closeConnection()
Closes all open connections to the databasevoid
connect(DatabaseConnector.ConnectionCallback callback)
Executes a callback with a Connection passed and automatically closes it when finishedboolean
isInitialized()
Checks if the connection to the database has been created
-
Constructor Details
-
MySQLConnector
public MySQLConnector(org.bukkit.plugin.Plugin plugin, java.lang.String hostname, int port, java.lang.String database, java.lang.String username, java.lang.String password, boolean useSSL)
-
-
Method Details
-
isInitialized
public boolean isInitialized()Description copied from interface:DatabaseConnector
Checks if the connection to the database has been created- Specified by:
isInitialized
in interfaceDatabaseConnector
- Returns:
- true if the connection is created, otherwise false
-
closeConnection
public void closeConnection()Description copied from interface:DatabaseConnector
Closes all open connections to the database- Specified by:
closeConnection
in interfaceDatabaseConnector
-
connect
Description copied from interface:DatabaseConnector
Executes a callback with a Connection passed and automatically closes it when finished- Specified by:
connect
in interfaceDatabaseConnector
- Parameters:
callback
- The callback to execute once the connection is retrieved
-