spyconnection.java
来自「RESIN 3.2 最新源码」· Java 代码 · 共 736 行 · 第 1/2 页
JAVA
736 行
log.fine(getId() + ":exn-createStatement(" + e + ")"); throw e; } } public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { try { String stmtId = null; if (log.isLoggable(Level.FINE)) { stmtId = createStatementId(); log.fine(stmtId + ":createStatement(type=" + resultSetType + ",concurrency=" + resultSetConcurrency + ",holdability=" + resultSetHoldability + ")"); } Statement stmt; stmt = _conn.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability); return new SpyStatement(stmtId, this, stmt); } catch (SQLException e) { log.fine(getId() + ":exn-createStatement(" + e + ")"); throw e; } } public PreparedStatement prepareStatement(String sql) throws SQLException { try { String stmtId = null; if (log.isLoggable(Level.FINE)) { stmtId = createStatementId(); log.fine(stmtId + ":prepareStatement(" + sql + ")"); } PreparedStatement stmt; stmt = _conn.prepareStatement(sql); return new SpyPreparedStatement(stmtId, this, stmt, sql); } catch (SQLException e) { log.fine(getId() + ":exn-prepareStatement(" + e + ")"); throw e; } } public PreparedStatement prepareStatement(String sql, int resultSetType) throws SQLException { try { String stmtId = null; if (log.isLoggable(Level.FINE)) { stmtId = createStatementId(); log.fine(stmtId + ":prepareStatement(" + sql + ",type=" + resultSetType + ")"); } PreparedStatement stmt; stmt = _conn.prepareStatement(sql, resultSetType); return new SpyPreparedStatement(stmtId, this, stmt, sql); } catch (SQLException e) { log.fine(getId() + ":exn-prepareStatement(" + e + ")"); throw e; } } public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { try { String stmtId = null; if (log.isLoggable(Level.FINE)) { stmtId = createStatementId(); log.fine(stmtId + ":prepareStatement(" + sql + ",type=" + resultSetType + ",concurrency=" + resultSetConcurrency + ")"); } PreparedStatement stmt; stmt = _conn.prepareStatement(sql, resultSetType, resultSetConcurrency); return new SpyPreparedStatement(stmtId, this, stmt, sql); } catch (SQLException e) { log.fine(getId() + ":exn-prepareStatement(" + e + ")"); throw e; } } public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { return null; } public PreparedStatement prepareStatement(String sql, int []columnIndexes) throws SQLException { return null; } public PreparedStatement prepareStatement(String sql, String []columnNames) throws SQLException { return null; } public CallableStatement prepareCall(String sql) throws SQLException { try { if (log.isLoggable(Level.FINE)) log.fine(getId() + ":prepareCall(" + sql + ")"); CallableStatement stmt; stmt = _conn.prepareCall(sql); return stmt; } catch (SQLException e) { log.fine(getId() + ":exn-prepareCall(" + e + ")"); throw e; } } public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { try { if (log.isLoggable(Level.FINE)) log.fine(getId() + ":prepareCall(" + sql + ",type=" + resultSetType + ",concurrency=" + resultSetConcurrency + ")"); CallableStatement stmt; stmt = _conn.prepareCall(sql); return stmt; } catch (SQLException e) { log.fine(getId() + ":exn-prepareCall(" + e + ")"); throw e; } } public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { return null; } public boolean getAutoCommit() throws SQLException { try { boolean autoCommit = _conn.getAutoCommit(); log.fine(getId() + ":getAutoCommit() -> " + autoCommit); return autoCommit; } catch (SQLException e) { log.fine(getId() + ":exn-getAutoCommit(" + e + ")"); throw e; } } public void setAutoCommit(boolean autoCommit) throws SQLException { try { logXA.fine(getId() + ":setAutoCommit(" + autoCommit + ")"); _conn.setAutoCommit(autoCommit); } catch (SQLException e) { logXA.fine(getId() + ":exn-setAutoCommit(" + e + ")"); throw e; } } public void commit() throws SQLException { try { logXA.fine(getId() + ":commit()"); _conn.commit(); } catch (SQLException e) { logXA.fine(getId() + ":exn-commit(" + e + ")"); throw e; } } public void rollback() throws SQLException { try { logXA.fine(getId() + ":rollback()"); _conn.rollback(); } catch (SQLException e) { logXA.fine(getId() + ":exn-rollback(" + e + ")"); throw e; } } /** * Returns true if the connection is closed. */ public boolean isClosed() throws SQLException { try { boolean isClosed = _conn.isClosed(); log.fine(getId() + ":isClosed() -> " + isClosed); return isClosed; } catch (SQLException e) { log.fine(getId() + ":exn-isClosed(" + e + ")"); throw e; } } /** * Reset the connection and return the underlying JDBC connection to * the pool. */ public void close() throws SQLException { log.fine(getId() + ":close()"); try { _conn.close(); } catch (SQLException e) { log.fine(getId() + ":exn-close(" + e + ")"); throw e; } } public void setHoldability(int hold) throws SQLException { _conn.setHoldability(hold); } public int getHoldability() throws SQLException { return _conn.getHoldability(); } public Savepoint setSavepoint() throws SQLException { return _conn.setSavepoint(); } public Savepoint setSavepoint(String name) throws SQLException { return _conn.setSavepoint(name); } public void releaseSavepoint(Savepoint savepoint) throws SQLException { _conn.releaseSavepoint(savepoint); } public void rollback(Savepoint savepoint) throws SQLException { _conn.rollback(savepoint); } public String toString() { return "SpyConnection[id=" + getId() + ",conn=" + _conn + "]"; } public Clob createClob() throws SQLException { throw new UnsupportedOperationException("Not supported yet."); } public Blob createBlob() throws SQLException { throw new UnsupportedOperationException("Not supported yet."); } public NClob createNClob() throws SQLException { throw new UnsupportedOperationException("Not supported yet."); } public SQLXML createSQLXML() throws SQLException { throw new UnsupportedOperationException("Not supported yet."); } public boolean isValid(int timeout) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); } public void setClientInfo(String name, String value) throws SQLClientInfoException { throw new UnsupportedOperationException("Not supported yet."); } public void setClientInfo(Properties properties) throws SQLClientInfoException { throw new UnsupportedOperationException("Not supported yet."); } public String getClientInfo(String name) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); } public Properties getClientInfo() throws SQLException { throw new UnsupportedOperationException("Not supported yet."); } public Array createArrayOf(String typeName, Object[] elements) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); } public Struct createStruct(String typeName, Object[] attributes) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); } public <T> T unwrap(Class<T> iface) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); } public boolean isWrapperFor(Class<?> iface) throws SQLException { throw new UnsupportedOperationException("Not supported yet."); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?