Class AbstractMariaDBManager
java.lang.Object
io.github.mrtesz.teszcore.db.manager.AbstractDBManager
io.github.mrtesz.teszcore.db.manager.mariadb.AbstractMariaDBManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasync(int timeoutSecs) Creates an AsyncDBManager with same information as the current database managervoidConnects the manager to the database again, when it is not connectedvoidconnect()Connect the database manager with the databaseprotected @NotNull com.zaxxer.hikari.HikariConfigvoidClose the database managercallsDBManager.checkConnection()and returns a database connectionsync()Creates a SyncDBManager with same information as the current database manager (When called from an AsyncDBManager the param timeoutSeconds will be forgotten)Methods inherited from class io.github.mrtesz.teszcore.db.manager.AbstractDBManager
close, isClosedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.mrtesz.teszcore.api.db.manager.DBManager
async, buildSqlWithParams, getName
-
Field Details
-
infoWhenCredentialsAreNull
protected final boolean infoWhenCredentialsAreNull -
name
-
url
-
user
-
password
-
dataSource
protected com.zaxxer.hikari.HikariDataSource dataSource -
projectName
-
-
Constructor Details
-
AbstractMariaDBManager
public AbstractMariaDBManager()
-
-
Method Details
-
createHikariConfig
@NotNull protected @NotNull com.zaxxer.hikari.HikariConfig createHikariConfig() -
connect
Connect the database manager with the database- Throws:
IllegalStateException- if the DBManager is closedNullPointerException- if any of the credentials are null/empty
-
checkConnection
Description copied from interface:DBManagerConnects the manager to the database again, when it is not connected- Throws:
IllegalStateException- when the DBManager is closed
-
disconnect
-
getConnection
Description copied from interface:DBManagercallsDBManager.checkConnection()and returns a database connection- Returns:
- a database connection
- Throws:
IllegalStateException- when the DBManager is closed
-
async
Description copied from interface:DBManagerCreates an AsyncDBManager with same information as the current database manager- Parameters:
timeoutSecs- TheCompletableFuture.completeOnTimeout(T, long, java.util.concurrent.TimeUnit)time in seconds- Returns:
- an asynchronous copy of the current database manager
-
sync
Description copied from interface:DBManagerCreates a SyncDBManager with same information as the current database manager (When called from an AsyncDBManager the param timeoutSeconds will be forgotten)- Returns:
- a synchronous copy of the current database manager
-