use of com.alibaba.druid.proxy.jdbc.CallableStatementProxy in project druid by alibaba.
the class PreparedStatementPool method closeRemovedStatement.
public void closeRemovedStatement(PreparedStatementHolder holder) {
if (LOG.isDebugEnabled()) {
String message = null;
if (holder.statement instanceof PreparedStatementProxy) {
PreparedStatementProxy stmtProxy = (PreparedStatementProxy) holder.statement;
if (stmtProxy instanceof CallableStatementProxy) {
message = "{conn-" + stmtProxy.getConnectionProxy().getId() + ", cstmt-" + stmtProxy.getId() + "} exit cache";
} else {
message = "{conn-" + stmtProxy.getConnectionProxy().getId() + ", pstmt-" + stmtProxy.getId() + "} exit cache";
}
} else {
message = "stmt exit cache";
}
LOG.debug(message);
}
holder.setPooling(false);
if (holder.isInUse()) {
return;
}
if (holder.isEnterOracleImplicitCache()) {
try {
OracleUtils.exitImplicitCacheToClose(holder.statement);
} catch (Exception ex) {
LOG.error("exitImplicitCacheToClose error", ex);
}
}
dataSource.closePreapredStatement(holder);
}
use of com.alibaba.druid.proxy.jdbc.CallableStatementProxy in project druid by alibaba.
the class WallFilter method connection_prepareCall.
@Override
public CallableStatementProxy connection_prepareCall(FilterChain chain, ConnectionProxy connection, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
String dbType = connection.getDirectDataSource().getDbType();
WallContext.create(dbType);
try {
sql = check(sql);
CallableStatementProxy stmt = chain.connection_prepareCall(connection, sql, resultSetType, resultSetConcurrency, resultSetHoldability);
setSqlStatAttribute(stmt);
return stmt;
} finally {
WallContext.clearContext();
}
}
use of com.alibaba.druid.proxy.jdbc.CallableStatementProxy in project druid by alibaba.
the class FilterEventAdapter method connection_prepareCall.
@Override
public CallableStatementProxy connection_prepareCall(FilterChain chain, ConnectionProxy connection, String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
CallableStatementProxy statement = super.connection_prepareCall(chain, connection, sql, resultSetType, resultSetConcurrency);
statementPrepareCallAfter(statement);
return statement;
}
Aggregations