lib/arjdbc/abstract/core.rb
# Retrieve the raw `java.sql.Connection` object.
# The unwrap parameter is useful if an attempt to unwrap a pooled (JNDI)
# connection should be made - to really return the 'native' JDBC object.
# @param unwrap [true, false] whether to unwrap the connection object
# @return [Java::JavaSql::Connection] the JDBC connection
Retrieve the raw `java.sql.Connection` object.
The unwrap parameter is useful if an attempt to unwrap a pooled (JNDI)
connection should be made - to really return the 'native' JDBC object.
Retrieve the raw ` java . sql . Connection ` object . The unwrap parameter is useful if an attempt to unwrap a pooled ( JNDI ) connection should be made - to really return the ' native ' JDBC object .
def jdbc_connection(unwrap = false)
        java_connection = raw_connection.connection
        return java_connection unless unwrap
        connection_class = java.sql.Connection.java_class
        begin
          if java_connection.wrapper_for?(connection_class)
            return java_connection.unwrap(connection_class) 
          end
        rescue Java::JavaLang::AbstractMethodError => e
          ArJdbc.warn("driver/pool connection impl does not support unwrapping (#{e})")
        end
        if java_connection.respond_to?(:connection)
          java_connection.connection 
        else
          java_connection
        end
      end
def jdbc_connection ( unwrap = false ) java_connection = raw_connection . connection return java_connection unless unwrap connection_class = java . sql . Connection . java_class begin if java_connection . wrapper_for? ( connection_class ) return java_connection . unwrap ( connection_class ) end rescue Java :: JavaLang :: AbstractMethodError => e ArJdbc . warn ( "driver/pool connection impl does not support unwrapping (#{e})" ) end if java_connection . respond_to? ( :connection ) java_connection . connection else java_connection end end
Retrieve the raw `java.sql.Connection` object.
Retrieve the raw ` java . sql . Connection ` object .
# java.sql.Wrapper.unwrap # e.g. org.apache.tomcat.jdbc.pool.PooledConnection # getConnection
the JDBC connection
the JDBC connection
Java::JavaSql::Connection
unwrap
whether to unwrap the connection object
whether to unwrap the connection object