Package com.mckoi.database
Class InternalJDBCHelper
- java.lang.Object
-
- com.mckoi.database.InternalJDBCHelper
-
class InternalJDBCHelper extends java.lang.Object
Helper and convenience methods and classes for creating a JDBC interface that has direct access to an open transaction of a DatabaseConnection. This class allows us to provide JDBC access to stored procedures from inside the engine.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
InternalJDBCHelper.InternalConnection
A derived java.sql.Connection class from MConnection.private static class
InternalJDBCHelper.InternalDatabaseInterface
An implementation of DatabaseInterface used to execute queries on the DatabaseConnection and return results to the JDBC client.
-
Constructor Summary
Constructors Constructor Description InternalJDBCHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static java.sql.Connection
createJDBCConnection(User user, DatabaseConnection connection)
Returns a java.sql.Connection object that is bound to the given DatabaseConnection object.(package private) static void
disposeJDBCConnection(java.sql.Connection jdbc_connection)
Disposes the JDBC Connection object returned by the 'createJDBCConnection' method.
-
-
-
Method Detail
-
createJDBCConnection
static java.sql.Connection createJDBCConnection(User user, DatabaseConnection connection)
Returns a java.sql.Connection object that is bound to the given DatabaseConnection object. Queries executed on the Connection alter the currently open transaction.Note: It is assumed that the DatabaseConnection is locked in exclusive mode when a query is executed (eg. via the 'executeXXX' methods in Statement).
Note: Auto-commit is DISABLED for the SQL connection and can not be enabled.
-
disposeJDBCConnection
static void disposeJDBCConnection(java.sql.Connection jdbc_connection) throws java.sql.SQLException
Disposes the JDBC Connection object returned by the 'createJDBCConnection' method. This should be called to free resources associated with the connection object.After this has completed the given Connection object in invalidated.
- Throws:
java.sql.SQLException
-
-