java.lang.Object
io.opentelemetry.instrumentation.jdbc.internal.JdbcData

public final class JdbcData extends Object
Holds info associated with JDBC connections and prepared statements.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Field Details

    • connectionInfo

      public static final io.opentelemetry.instrumentation.api.util.VirtualField<Connection,DbInfo> connectionInfo
    • preparedStatement

      public static final io.opentelemetry.instrumentation.api.util.VirtualField<PreparedStatement,String> preparedStatement
  • Method Details

    • intern

      public static DbInfo intern(DbInfo dbInfo)
      Returns canonical representation of db info.
      Parameters:
      dbInfo - db info to canonicalize
      Returns:
      db info with same content as input db info. If two equal inputs are given to this method, both calls will return the same instance. This method may return one instance now and a different instance later if the original interned instance was garbage collected.
    • addStatementBatch

      public static void addStatementBatch(Statement statement, String sql)
    • addPreparedStatementBatch

      public static void addPreparedStatementBatch(PreparedStatement statement)
    • clearBatch

      public static void clearBatch(Statement statement)
    • getStatementBatchInfo

      public static JdbcData.StatementBatchInfo getStatementBatchInfo(Statement statement)
    • getPreparedStatementBatchSize

      public static Long getPreparedStatementBatchSize(PreparedStatement statement)
    • close

      public static void close(Statement statement)
    • getParameters

      public static Map<String,String> getParameters(PreparedStatement statement)
    • addParameter

      public static void addParameter(PreparedStatement statement, String key, String value)
    • clearParameters

      public static void clearParameters(PreparedStatement statement)