DBManager

  
Type🟢 Interface
Packageio.github.mrtesz.teszcore.api.db.manager
GitHubDBManager.java
ExtendsCopyable<DBManager>

Description

Parent interface of all database managers


Methods

getName

String getName();

Get the name of this database manager

Returns: String — the name of the database manager


isClosed

boolean isClosed();

Show if the database manager is closed

Returns: boolean — true if the database manager is closed


close

void close();

Close the database manager


connect

void connect() throws IllegalStateException;

Connect the database manager with the database

Throws: IllegalStateException when isClosed() is true


disconnect

void disconnect();

Close the database manager


checkConnection

void checkConnection() throws IllegalStateException;

Connects the manager to the database again, when it is not connected

Throws: IllegalStateException when the database manager is closed


getConnection

Connection getConnection();

calls checkConnection() and returns a database connection

Returns: Connection a database connection

Throws: IllegalStateException when the database manager is closed


async

AsyncDBManager async();
AsyncDBManager async(int timeoutSeconds);

Creates an AsyncDBManager with same information as the current database manager

ParameterTypeAnnotationsDescription
timeoutSecondsint (optional) The completeOnTimeout time in seconds Default: 2

Returns: AsyncDBManager - an asynchronous copy of the current database manager


sync

SyncDBManager sync();

Creates a SyncDBManager with same information as the current database manager (When called from an AsyncDBManager the param timeoutSeconds will be forgotten)

Returns: SyncDBManager - a synchronous copy of the current database manager


buildSqlWithParams

String buildSqlWithParams(String sql, @NotNull List<Object> params, boolean cut);

Creates a SQL statement by replacing question marks with the params list

Returns: String - the SQL with replaced question marks



Back to top

Copyright © 2026 Mr_Tesz. All rights reserved

This site uses Just the Docs, a documentation theme for Jekyll.