Package net.twilightmc.skReflectabase
Class DatabaseManager
java.lang.Object
net.twilightmc.skReflectabase.DatabaseManager
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate Connection
private final String
private final org.bukkit.plugin.Plugin
private final String
private final String
-
Constructor Summary
ConstructorDescriptionDatabaseManager
(org.bukkit.plugin.Plugin plugin, String url, String username, String password) -
Method Summary
Modifier and TypeMethodDescriptionvoid
private void
connect()
executeQuery
(String query) executeQuery
(String query, Object... params) executeQueryAsync
(String query) executeQueryAsync
(String query, Object... params) void
executeQueryAsync
(String query, Consumer<DatabaseManager.QueryResult> callback) void
executeQueryAsync
(String query, Consumer<DatabaseManager.QueryResult> callback, Object... params) int
executeUpdate
(String query) int
executeUpdate
(String query, Object... params) executeUpdateAsync
(String query) executeUpdateAsync
(String query, Object... params) void
executeUpdateAsync
(String query, Consumer<Integer> callback) void
executeUpdateAsync
(String query, Consumer<Integer> callback, Object... params) getTableColumns
(String tableName) getTableColumnsAsync
(String tableName) private PreparedStatement
prepareStatement
(String query, Object... params) boolean
tableExists
(String tableName) tableExistsAsync
(String tableName)
-
Field Details
-
plugin
private final org.bukkit.plugin.Plugin plugin -
connection
-
url
-
username
-
password
-
-
Constructor Details
-
DatabaseManager
public DatabaseManager(org.bukkit.plugin.Plugin plugin, String url, String username, String password) throws SQLException - Throws:
SQLException
-
-
Method Details
-
connect
- Throws:
SQLException
-
closeConnection
public void closeConnection() -
executeQuery
- Throws:
SQLException
-
executeQuery
- Throws:
SQLException
-
executeUpdate
- Throws:
SQLException
-
executeUpdate
- Throws:
SQLException
-
executeQueryAsync
-
executeQueryAsync
public CompletableFuture<DatabaseManager.QueryResult> executeQueryAsync(String query, Object... params) -
executeUpdateAsync
-
executeUpdateAsync
-
executeQueryAsync
-
executeQueryAsync
public void executeQueryAsync(String query, Consumer<DatabaseManager.QueryResult> callback, Object... params) -
executeUpdateAsync
-
executeUpdateAsync
-
tableExists
- Throws:
SQLException
-
tableExistsAsync
-
getTableColumns
- Throws:
SQLException
-
getTableColumnsAsync
-
prepareStatement
- Throws:
SQLException
-
getConnection
- Throws:
SQLException
-