Skip to content

Commit a98a3c9

Browse files
committed
Align library PreparedStatement instrumentation with javaagent
Remove parameter capture from methods that are not instrumented in the javaagent version: - setByte: not captured in javaagent - setObject(int, Object, int, int): 4-parameter overload not captured - setObject(int, Object, SQLType): JDBC 4.2 method not captured - setObject(int, Object, SQLType, int): JDBC 4.2 method not captured This ensures library and javaagent instrumentation have consistent behavior.
1 parent ce7a2fc commit a98a3c9

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

instrumentation/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/OpenTelemetryPreparedStatement.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public void setBoolean(int parameterIndex, boolean x) throws SQLException {
107107
@Override
108108
public void setByte(int parameterIndex, byte x) throws SQLException {
109109
delegate.setByte(parameterIndex, x);
110-
putParameter(parameterIndex, String.valueOf(x));
111110
}
112111

113112
@Override
@@ -258,7 +257,6 @@ public void setObject(int parameterIndex, Object x) throws SQLException {
258257
public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)
259258
throws SQLException {
260259
delegate.setObject(parameterIndex, x, targetSqlType, scaleOrLength);
261-
putParameter(parameterIndex, x);
262260
}
263261

264262
@Override
@@ -422,13 +420,11 @@ private <T, E extends Exception> T wrapBatchCall(ThrowingSupplier<T, E> callable
422420
public void setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength)
423421
throws SQLException {
424422
delegate.setObject(parameterIndex, x, targetSqlType, scaleOrLength);
425-
putParameter(parameterIndex, x);
426423
}
427424

428425
@Override
429426
public void setObject(int parameterIndex, Object x, SQLType targetSqlType) throws SQLException {
430427
delegate.setObject(parameterIndex, x, targetSqlType);
431-
putParameter(parameterIndex, x);
432428
}
433429

434430
@Override

0 commit comments

Comments
 (0)