/** * Return the base underlying data store connection. */ public Connection getInnermostDelegate() { return (_del == null) ? _conn : _del.getInnermostDelegate(); }
/** * Return the base underlying data store connection. */ public Connection getInnermostDelegate() { return (_del == null) ? _conn : _del.getInnermostDelegate(); }
/** * Return the base underlying data store connection. */ public Connection getInnermostDelegate() { return (_del == null) ? _conn : _del.getInnermostDelegate(); }
/** * Return the base underlying data store connection. */ public Connection getInnermostDelegate() { return (_del == null) ? _conn : _del.getInnermostDelegate(); }
public boolean equals(Object other) { if (other == this) return true; if (other instanceof DelegatingConnection) other = ((DelegatingConnection) other).getInnermostDelegate(); return getInnermostDelegate().equals(other); }
public boolean equals(Object other) { if (other == this) return true; if (other instanceof DelegatingConnection) other = ((DelegatingConnection) other).getInnermostDelegate(); return getInnermostDelegate().equals(other); }
public boolean equals(Object other) { if (other == this) return true; if (other instanceof DelegatingConnection) other = ((DelegatingConnection) other).getInnermostDelegate(); return getInnermostDelegate().equals(other); }
public boolean equals(Object other) { if (other == this) return true; if (other instanceof DelegatingConnection) other = ((DelegatingConnection) other).getInnermostDelegate(); return getInnermostDelegate().equals(other); }
public int hashCode() { return getInnermostDelegate().hashCode(); }
public int hashCode() { return getInnermostDelegate().hashCode(); }
public int hashCode() { return getInnermostDelegate().hashCode(); }
public int hashCode() { return getInnermostDelegate().hashCode(); }
/** * Get the native PostgreSQL connection from the given connection. * Various attempts of unwrapping are being performed. */ protected PGConnection getPGConnection(DelegatingConnection conn) { Connection innerConn = conn.getInnermostDelegate(); if (innerConn instanceof PGConnection) { return (PGConnection) innerConn; } if (innerConn.getClass().getName().startsWith("org.apache.commons.dbcp")) { return (PGConnection) getDbcpDelegate(innerConn); } return (PGConnection) unwrapConnection(conn, PGConnection.class); }
/** * Get the native PostgreSQL connection from the given connection. * Various attempts of unwrapping are being performed. */ protected PGConnection getPGConnection(DelegatingConnection conn) { Connection innerConn = conn.getInnermostDelegate(); if (innerConn instanceof PGConnection) { return (PGConnection) innerConn; } if (innerConn.getClass().getName().startsWith("org.apache.commons.dbcp")) { return (PGConnection) getDbcpDelegate(innerConn); } return (PGConnection) unwrapConnection(conn, PGConnection.class); }
/** * Get the native PostgreSQL connection from the given connection. * Various attempts of unwrapping are being performed. */ protected PGConnection getPGConnection(DelegatingConnection conn) { Connection innerConn = conn.getInnermostDelegate(); if (innerConn instanceof PGConnection) { return (PGConnection) innerConn; } if (innerConn.getClass().getName().startsWith("org.apache.commons.dbcp")) { return (PGConnection) getDbcpDelegate(innerConn); } return (PGConnection) unwrapConnection(conn, PGConnection.class); }
/** * Get the native PostgreSQL connection from the given connection. * Various attempts of unwrapping are being performed. */ protected PGConnection getPGConnection(DelegatingConnection conn) { Connection innerConn = conn.getInnermostDelegate(); if (innerConn instanceof PGConnection) { return (PGConnection) innerConn; } if (innerConn.getClass().getName().startsWith("org.apache.commons.dbcp")) { return (PGConnection) getDbcpDelegate(innerConn); } return (PGConnection) unwrapConnection(conn, PGConnection.class); }
public InputStream getLOBStream(JDBCStore store, ResultSet rs, int column) throws SQLException { DelegatingConnection conn = (DelegatingConnection)store .getConnection(); conn.setAutoCommit(false); LargeObjectManager lom = ((PGConnection)conn.getInnermostDelegate()) .getLargeObjectAPI(); if (rs.getInt(column) != -1) { LargeObject lo = lom.open(rs.getInt(column)); return lo.getInputStream(); } else { return null; } }
conn.setAutoCommit(false); PGConnection pgconn = (PGConnection)conn .getInnermostDelegate(); LargeObjectManager lom = pgconn.getLargeObjectAPI(); lom.delete(oid);
conn.setAutoCommit(false); PGConnection pgconn = (PGConnection)conn .getInnermostDelegate(); LargeObjectManager lom = pgconn.getLargeObjectAPI(); if (ob != null) { conn.setAutoCommit(false); PGConnection pgconn = (PGConnection)conn .getInnermostDelegate(); LargeObjectManager lom = pgconn.getLargeObjectAPI(); oid = lom.create();
private void insertPostgresBlob(Row row, Column col, JDBCStore store, Object ob) throws SQLException { if (ob != null) { col.setType(Types.INTEGER); DelegatingConnection conn = (DelegatingConnection)store .getConnection(); try { conn.setAutoCommit(false); PGConnection pgconn = (PGConnection) conn.getInnermostDelegate(); LargeObjectManager lom = pgconn.getLargeObjectAPI(); // The create method is valid in versions previous 8.3 // in 8.3 this methos is deprecated, use createLO int oid = lom.create(); LargeObject lo = lom.open(oid, LargeObjectManager.WRITE); OutputStream os = lo.getOutputStream(); copy((InputStream)ob, os); lo.close(); row.setInt(col, oid); } catch (IOException ioe) { throw new StoreException(ioe); } finally { conn.close(); } } else { row.setInt(col, -1); } }