Package co.aikar.idb
Class BaseDatabase
- java.lang.Object
-
- co.aikar.idb.BaseDatabase
-
- All Implemented Interfaces:
Database
- Direct Known Subclasses:
HikariPooledDatabase
public class BaseDatabase extends java.lang.Object implements Database
-
-
Constructor Summary
Constructors Constructor Description BaseDatabase(DatabaseOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(long timeout, java.util.concurrent.TimeUnit unit)Called in onDisable, destroys the Data source and nulls out references.<T> java.util.concurrent.CompletableFuture<T>dispatchAsync(java.util.concurrent.Callable<T> task)java.sql.ConnectiongetConnection()Get a JDBC Connectionjava.util.logging.LoggergetLogger()Get the LoggerDatabaseOptionsgetOptions()Get the options objectDatabaseTimingtimings(java.lang.String name)Create a Timings object-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface co.aikar.idb.Database
close, closeConnection, createStatement, createTransaction, createTransactionAsync, createTransactionAsync, executeInsert, executeUpdate, executeUpdateAsync, fatalError, getFirstColumn, getFirstColumnAsync, getFirstColumnResults, getFirstColumnResultsAsync, getFirstRow, getFirstRowAsync, getResults, getResultsAsync, logException, logException, query, queryAsync
-
-
-
-
Constructor Detail
-
BaseDatabase
public BaseDatabase(DatabaseOptions options)
-
-
Method Detail
-
close
public void close(long timeout, java.util.concurrent.TimeUnit unit)Description copied from interface:DatabaseCalled in onDisable, destroys the Data source and nulls out references.
-
dispatchAsync
public <T> java.util.concurrent.CompletableFuture<T> dispatchAsync(java.util.concurrent.Callable<T> task)
- Specified by:
dispatchAsyncin interfaceDatabase
-
timings
public DatabaseTiming timings(java.lang.String name)
Description copied from interface:DatabaseCreate a Timings object
-
getOptions
public DatabaseOptions getOptions()
Description copied from interface:DatabaseGet the options object- Specified by:
getOptionsin interfaceDatabase
-
getLogger
public java.util.logging.Logger getLogger()
Description copied from interface:DatabaseGet the Logger
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLExceptionDescription copied from interface:DatabaseGet a JDBC Connection- Specified by:
getConnectionin interfaceDatabase- Throws:
java.sql.SQLException
-
-