public Connection unwrap(Connection conn) { if (!canUnwrap(conn)) throw new IllegalArgumentException( "This unwrapper can only handle instances of " + DelegatingConnection.class); Connection unwrapped = ((DelegatingConnection) conn).getInnermostDelegate(); if (unwrapped == null) throw new RuntimeException( "Could not unwrap connection. Is the DBCP pool configured " + "to allow access to underlying connections?"); return unwrapped; }
Connection underlyingOlapConnection = dc.getInnermostDelegate(); OlapConnection olapConnection = unwrap(underlyingOlapConnection, OlapConnection.class);
public boolean innermostDelegateEquals(Connection c) { Connection innerCon = super.getInnermostDelegate(); if (innerCon == null) { return c == null; } else { return innerCon.equals(c); } }
public boolean innermostDelegateEquals(Connection c) { Connection innerCon = super.getInnermostDelegate(); if (innerCon == null) { return c == null; } else { return innerCon.equals(c); } }
public boolean innermostDelegateEquals(Connection c) { Connection innerCon = super.getInnermostDelegate(); if (innerCon == null) { return c == null; } else { return innerCon.equals(c); } }
public int hashCode() { Object obj = getInnermostDelegate(); if (obj == null) { return 0; } return obj.hashCode(); }
/** * Compares innermost delegate to the given connection. * * @param c connection to compare innermost delegate with * @return true if innermost delegate equals <code>c</code> * @since 1.2.2 */ public boolean innermostDelegateEquals(Connection c) { Connection innerCon = getInnermostDelegate(); if (innerCon == null) { return c == null; } else { return innerCon.equals(c); } }
/** * @see org.apache.commons.dbcp.DelegatingConnection#getInnermostDelegate() */ public Connection getInnermostDelegate() { if (isAccessToUnderlyingConnectionAllowed()) { return super.getInnermostDelegate(); } else { return null; } } }
/** * @see org.apache.commons.dbcp.DelegatingConnection#getInnermostDelegate() */ public Connection getInnermostDelegate() { if (isAccessToUnderlyingConnectionAllowed()) { return super.getInnermostDelegate(); } else { return null; } } }
/** * @see org.apache.commons.dbcp.DelegatingConnection#getInnermostDelegate() */ public Connection getInnermostDelegate() { if (isAccessToUnderlyingConnectionAllowed()) { return super.getInnermostDelegate(); } else { return null; } } }
/** * Needed for pre-10R2 Oracle blob support....:( * * This method actually assumes that we are using commons DBCP 1.2.2. * * @param con the commons-DBCP {@code DelegatingConnection} to unwrap * @return the unwrapped connection */ public static Connection unwrap(Connection con) throws SQLException { if (con instanceof DelegatingConnection) { return ((DelegatingConnection)con).getInnermostDelegate(); } else { throw new SQLException("failed to unwrap connection of class " + con.getClass().getName() + ", expected it to be a " + DelegatingConnection.class.getName()); } }
/** * Needed for pre-10R2 Oracle blob support....:( * * This method actually assumes that we are using commons DBCP 1.2.2. * * @param con the commons-DBCP {@code DelegatingConnection} to unwrap * @return the unwrapped connection */ public static Connection unwrap(Connection con) throws SQLException { if (con instanceof DelegatingConnection) { return ((DelegatingConnection)con).getInnermostDelegate(); } else { throw new SQLException("failed to unwrap connection of class " + con.getClass().getName() + ", expected it to be a " + DelegatingConnection.class.getName()); } }
/** * Needed for pre-10R2 Oracle blob support....:( * * This method actually assumes that we are using commons DBCP 1.2.2. * * @param con the commons-DBCP {@code DelegatingConnection} to unwrap * @return the unwrapped connection */ public static Connection unwrap(Connection con) throws SQLException { if (con instanceof DelegatingConnection) { return ((DelegatingConnection)con).getInnermostDelegate(); } else { throw new SQLException("failed to unwrap connection of class " + con.getClass().getName() + ", expected it to be a " + DelegatingConnection.class.getName()); } }
public Connection unwrap(Connection conn) { if (!canUnwrap(conn)) throw new IllegalArgumentException("This unwrapper can only handle instances of " + DelegatingConnection.class); Connection unwrapped = ((DelegatingConnection) conn).getInnermostDelegate(); if (unwrapped == null) throw new RuntimeException("Could not unwrap connection. Is the DBCP pool configured " + "to allow access to underlying connections?"); return unwrapped; }
/** * @see org.apache.commons.dbcp.DelegatingConnection#getInnermostDelegate() */ public Connection getInnermostDelegate() { if (isAccessToUnderlyingConnectionAllowed()) { return super.getInnermostDelegate(); } else { return null; } } }
/** * @see org.apache.commons.dbcp.DelegatingConnection#getInnermostDelegate() */ public Connection getInnermostDelegate() { if (isAccessToUnderlyingConnectionAllowed()) { return super.getInnermostDelegate(); } else { return null; } } }
/** * @see org.apache.commons.dbcp.DelegatingConnection#getInnermostDelegate() */ public Connection getInnermostDelegate() { if (isAccessToUnderlyingConnectionAllowed()) { return super.getInnermostDelegate(); } else { return null; } } }
public Connection unwrap(Connection conn) { if (!canUnwrap(conn)) throw new IllegalArgumentException("This unwrapper can only handle instances of " + DelegatingConnection.class); Connection unwrapped = ((DelegatingConnection) conn).getInnermostDelegate(); if (unwrapped == null) throw new RuntimeException("Could not unwrap connection. Is the DBCP pool configured " + "to allow access to underlying connections?"); return unwrapped; }
public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } Connection delegate = getInnermostDelegate(); if (delegate == null) { return false; } if (obj instanceof DelegatingConnection) { DelegatingConnection c = (DelegatingConnection) obj; return c.innermostDelegateEquals(delegate); } else { return delegate.equals(obj); } }
public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } // Use superclass accessor to skip access test Connection conn = super.getInnermostDelegate(); if (conn == null) { return false; } if (obj instanceof DelegatingConnection) { DelegatingConnection c = (DelegatingConnection) obj; return c.innermostDelegateEquals(conn); } else { return conn.equals(obj); } }