@Override public void exception(ExecuteContext ctx) { SQLException ex = ctx.sqlException(); Statement stmt = ctx.statement(); Connection con = ctx.getConnection(); DataSource dataSource = ctx.getDataSource(); JdbcUtils.closeStatement(stmt); ctx.exception(getExceptionTranslator(dataSource).translate("jOOQ", ctx.sql(), ex)); }
/** * Default implementation for preparing a statement. Subclasses may override * this method. */ protected void prepare(ExecuteContext ctx) throws SQLException { ctx.statement(ctx.connection().prepareStatement(ctx.sql())); }
/** * Default implementation for preparing a statement. Subclasses may override * this method. */ protected void prepare(ExecuteContext ctx) throws SQLException { ctx.statement(ctx.connection().prepareStatement(ctx.sql())); }
@Override public void renderEnd(ExecuteContext ctx) { throw new QueryCollectorSignal(ctx.sql(), ctx.query()); } }
@Override public void renderEnd(ExecuteContext ctx) { throw new QueryCollectorSignal(ctx.sql(), ctx.query()); } }
results.resultsOrRows().add(new ResultOrRowsImpl(Tools.translate(ctx.sql(), e)));
private final SQLException execute0(ExecuteContext ctx, ExecuteListener listener) throws SQLException { listener.executeStart(ctx); SQLException e = executeStatementAndGetFirstResultSet(ctx, 0); listener.executeEnd(ctx); if (e != null) results.resultsOrRows().add(new ResultOrRowsImpl(Tools.translate(ctx.sql(), e))); return e; }
ctx.statement(ctx.connection().prepareStatement(ctx.sql(), type, concurrency)); ctx.statement(ctx.connection().prepareStatement(ctx.sql(), type, concurrency, resultSetHoldability)); ctx.statement(ctx.connection().prepareStatement(ctx.sql(), TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE)); ctx.statement(ctx.connection().prepareStatement(ctx.sql()));
log.debug("Executing query", newline + ctx.sql()); if (!ctx.sql().equals(inlined)) log.debug("-> with bind values", newline + inlined); log.debug("Calling routine", newline + ctx.sql()); if (!ctx.sql().equals(inlined)) log.debug("-> with bind values", newline + inlined); else if (!StringUtils.isBlank(ctx.sql())) { log.debug("Executing batch query", newline + ctx.sql()); else log.debug("Executing query", newline + ctx.sql());
log.debug("Executing query", ctx.sql()); if (!ctx.sql().equals(inlined)) { log.debug("-> with bind values", inlined); log.debug("Calling routine", ctx.sql()); if (!ctx.sql().equals(inlined)) { log.debug("-> with bind values", inlined); else if (!StringUtils.isBlank(ctx.sql())) { log.debug("Executing batch query", ctx.sql()); log.debug("Executing query", ctx.sql());
ctx.statement(ctx.connection().prepareStatement(ctx.sql(), type, concurrency)); ctx.statement(ctx.connection().prepareStatement(ctx.sql(), type, concurrency, resultSetHoldability)); ctx.statement(ctx.connection().prepareStatement(ctx.sql(), TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE)); ctx.statement(ctx.connection().prepareStatement(ctx.sql()));
@Override public void renderEnd(ExecuteContext ctx) { if (ctx.type() == ExecuteType.READ) { // Don't log writes (so as to not loop on collector) brave.clientTracer().startNewSpan("query"); brave.clientTracer().setCurrentClientServiceName("zipkin-query"); String[] batchSQL = ctx.batchSQL(); if (!StringUtils.isBlank(ctx.sql())) { brave.clientTracer().submitBinaryAnnotation("jdbc.query", ctx.sql()); } else if (batchSQL.length > 0 && batchSQL[batchSQL.length - 1] != null) { brave.clientTracer().submitBinaryAnnotation("jdbc.query", StringUtils.join(batchSQL, '\n')); } brave.clientTracer().setClientSent(jdbcEndpoint.ipv4, jdbcEndpoint.port, jdbcEndpoint.serviceName); } }