Skip to content

can not get sqlwithvalues when use onAfterExecuteQuery #527

Open
@xu1009

Description

@xu1009

when i use JdbcEventListener

@OverRide
public void onAfterExecuteQuery(PreparedStatementInformation statementInformation,
long timeElapsedNanos, SQLException e) {

    long cost = TimeUnit.NANOSECONDS.toMillis(timeElapsedNanos);
    if (cost >= slowQueryThresholdInMill) {
        log.warn("slow query is {} cost is {} ms", statementInformation.getSqlWithValues(),
                cost);
    }
    statementInformation.incrementTimeElapsed(timeElapsedNanos);
    super.onAfterExecuteQuery(statementInformation, timeElapsedNanos, e);
}

statementInformation.getSqlWithValues() can not print sql values

print sql:

select max(t0.date) from interface.stats t0 where t0.type = ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions