Package com.mckoi.database
Class DatabaseConnection.DCProcedureConnection
- java.lang.Object
-
- com.mckoi.database.DatabaseConnection.DCProcedureConnection
-
- All Implemented Interfaces:
ProcedureConnection
- Enclosing class:
- DatabaseConnection
private class DatabaseConnection.DCProcedureConnection extends java.lang.Object implements ProcedureConnection
An implementation of ProcedureConnection generated from this object.
-
-
Field Summary
Fields Modifier and Type Field Description private java.sql.Connection
jdbc_connection
The JDBCConnection created by this object.private User
previous_user
The User of this connection before this procedure was started.private boolean
transaction_disabled_flag
The 'close_transaction_disabled' flag when this connection was created.
-
Constructor Summary
Constructors Modifier Constructor Description private
DCProcedureConnection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
dispose()
Database
getDatabase()
Returns the Database object for this database providing access to various general database features including backing up replication and configuration.java.sql.Connection
getJDBCConnection()
Returns a JDBC Connection implementation for executing queries on this connection.
-
-
-
Field Detail
-
previous_user
private User previous_user
The User of this connection before this procedure was started.
-
transaction_disabled_flag
private boolean transaction_disabled_flag
The 'close_transaction_disabled' flag when this connection was created.
-
jdbc_connection
private java.sql.Connection jdbc_connection
The JDBCConnection created by this object.
-
-
Method Detail
-
getJDBCConnection
public java.sql.Connection getJDBCConnection()
Description copied from interface:ProcedureConnection
Returns a JDBC Connection implementation for executing queries on this connection. The Connection has auto-commit turned off, and it disables the ability for the connection to 'commit' changes to the database.This method is intended to provide the procedure developer with a convenient and consistent way to query and manipulate the database from the body of a stored procedure method.
The java.sql.Connection object returned here may invalidate when the procedure invokation call ends so the returned object must not be cached to be used again later.
The returned java.sql.Connection object is NOT thread safe and should only be used by a single thread. Accessing this connection from multiple threads will result in undefined behaviour.
The Connection object returned here has the same privs as the user who owns the stored procedure.
- Specified by:
getJDBCConnection
in interfaceProcedureConnection
-
getDatabase
public Database getDatabase()
Description copied from interface:ProcedureConnection
Returns the Database object for this database providing access to various general database features including backing up replication and configuration. Some procedures may not be allowed access to this object in which case a ProcedureException is thrown notifying of the security violation.- Specified by:
getDatabase
in interfaceProcedureConnection
-
dispose
void dispose()
-
-