接口 NativeJdbcExtractor

    • 方法详细资料

      • isNativeConnectionNecessaryForNativeStatements

        boolean isNativeConnectionNecessaryForNativeStatements()
        Return whether it is necessary to work on the native Connection to receive native Statements.

        This should be true if the connection pool does not allow to extract the native JDBC objects from its Statement wrapper but supports a way to retrieve the native JDBC Connection. This way, applications can still receive native Statements and ResultSet via working on the native JDBC Connection.

      • isNativeConnectionNecessaryForNativePreparedStatements

        boolean isNativeConnectionNecessaryForNativePreparedStatements()
        Return whether it is necessary to work on the native Connection to receive native PreparedStatements.

        This should be true if the connection pool does not allow to extract the native JDBC objects from its PreparedStatement wrappers but supports a way to retrieve the native JDBC Connection. This way, applications can still receive native Statements and ResultSet via working on the native JDBC Connection.

      • isNativeConnectionNecessaryForNativeCallableStatements

        boolean isNativeConnectionNecessaryForNativeCallableStatements()
        Return whether it is necessary to work on the native Connection to receive native CallableStatements.

        This should be true if the connection pool does not allow to extract the native JDBC objects from its CallableStatement wrappers but supports a way to retrieve the native JDBC Connection. This way, applications can still receive native Statements and ResultSet via working on the native JDBC Connection.

      • getNativeConnection

        Connection getNativeConnection​(Connection con)
                                throws SQLException
        Retrieve the underlying native JDBC Connection for the given Connection. Supposed to return the given Connection if not capable of unwrapping.
        参数:
        con - the Connection handle, potentially wrapped by a connection pool
        返回:
        the underlying native JDBC Connection, if possible; else, the original Connection
        抛出:
        SQLException - if thrown by JDBC methods
      • getNativeConnectionFromStatement

        Connection getNativeConnectionFromStatement​(Statement stmt)
                                             throws SQLException
        Retrieve the underlying native JDBC Connection for the given Statement. Supposed to return the Statement.getConnection() if not capable of unwrapping.

        Having this extra method allows for more efficient unwrapping if data access code already has a Statement. Statement.getConnection() often returns the native JDBC Connection even if the Statement itself is wrapped by a pool.

        参数:
        stmt - the Statement handle, potentially wrapped by a connection pool
        返回:
        the underlying native JDBC Connection, if possible; else, the original Connection
        抛出:
        SQLException - if thrown by JDBC methods
        另请参阅:
        Statement.getConnection()
      • getNativeStatement

        Statement getNativeStatement​(Statement stmt)
                              throws SQLException
        Retrieve the underlying native JDBC Statement for the given Statement. Supposed to return the given Statement if not capable of unwrapping.
        参数:
        stmt - the Statement handle, potentially wrapped by a connection pool
        返回:
        the underlying native JDBC Statement, if possible; else, the original Statement
        抛出:
        SQLException - if thrown by JDBC methods
      • getNativePreparedStatement

        PreparedStatement getNativePreparedStatement​(PreparedStatement ps)
                                              throws SQLException
        Retrieve the underlying native JDBC PreparedStatement for the given statement. Supposed to return the given PreparedStatement if not capable of unwrapping.
        参数:
        ps - the PreparedStatement handle, potentially wrapped by a connection pool
        返回:
        the underlying native JDBC PreparedStatement, if possible; else, the original PreparedStatement
        抛出:
        SQLException - if thrown by JDBC methods
      • getNativeCallableStatement

        CallableStatement getNativeCallableStatement​(CallableStatement cs)
                                              throws SQLException
        Retrieve the underlying native JDBC CallableStatement for the given statement. Supposed to return the given CallableStatement if not capable of unwrapping.
        参数:
        cs - the CallableStatement handle, potentially wrapped by a connection pool
        返回:
        the underlying native JDBC CallableStatement, if possible; else, the original CallableStatement
        抛出:
        SQLException - if thrown by JDBC methods
      • getNativeResultSet

        ResultSet getNativeResultSet​(ResultSet rs)
                              throws SQLException
        Retrieve the underlying native JDBC ResultSet for the given statement. Supposed to return the given ResultSet if not capable of unwrapping.
        参数:
        rs - the ResultSet handle, potentially wrapped by a connection pool
        返回:
        the underlying native JDBC ResultSet, if possible; else, the original ResultSet
        抛出:
        SQLException - if thrown by JDBC methods