Interface ProcedureConnection


  • public interface ProcedureConnection
    An interface for accessing a database connection inside a stored procedure.
    Author:
    Tobias Downer
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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.
    • Method Detail

      • getJDBCConnection

        java.sql.Connection getJDBCConnection()
        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.

      • getDatabase

        Database getDatabase()
        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.