Class UncloseableSqlConnection
java.lang.Object
ch.nolix.base.sql.connection.UncloseableSqlConnection
- All Implemented Interfaces:
Closeable, CloseStateRequestable, GroupCloseable, ISqlConnection, AutoCloseable
A
UncloseableSqlConnection is a ISqlConnection that is a
wrapper around another ISqlConnection. When the close method of a
UncloseableSqlConnection is called, the
UncloseableSqlConnection and its wrapped ISqlConnection will
not be closed.- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteStatement(String statement) voidexecuteStatements(IContainer<String> statements) voidexecuteStatements(String... statements) static UncloseableSqlConnectionforSqlConnection(ISqlConnection sqlConnection) getRecordsFromQuery(String query) getSingleRecordFromQuery(String query) voidLets the currentGroupCloseablenote a close.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CloseStateRequestable
isOpenMethods inherited from interface GroupCloseable
close, createCloseDependencyTo, isClosed
-
Method Details
-
forSqlConnection
- Parameters:
sqlConnection-- Returns:
- either a new
UncloseableSqlConnectionfor the given sqlConnection or the given sqlConnection if the given sqlConnection is aUncloseableSqlConnection. - Throws:
RuntimeException- if the given sqlConnection is null or not open.
-
executeStatement
- Specified by:
executeStatementin interfaceISqlConnection
-
executeStatements
- Specified by:
executeStatementsin interfaceISqlConnection
-
executeStatements
- Specified by:
executeStatementsin interfaceISqlConnection
-
getDatabaseEngine
- Specified by:
getDatabaseEnginein interfaceISqlConnection
-
getRecordsFromQuery
- Specified by:
getRecordsFromQueryin interfaceISqlConnection
-
getSingleRecordFromQuery
- Specified by:
getSingleRecordFromQueryin interfaceISqlConnection
-
getStoredCloseController
- Specified by:
getStoredCloseControllerin interfaceGroupCloseable- Returns:
- the
ICloseControllerof the currentGroupCloseable.
-
noteClose
public void noteClose()Lets the currentGroupCloseablenote a close.- Specified by:
noteClosein interfaceGroupCloseable
-