diff --git a/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/common/pinot/WrappedPinotPreparedStatement.java b/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/common/pinot/WrappedPinotPreparedStatement.java index d86c8148857a..9a43e52e91a5 100644 --- a/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/common/pinot/WrappedPinotPreparedStatement.java +++ b/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/common/pinot/WrappedPinotPreparedStatement.java @@ -33,11 +33,12 @@ public WrappedPinotPreparedStatement(PinotConnection connection, String query) { @Override public boolean execute() throws SQLException { - ResultSet resultSet = executeQuery(); - if (resultSet.isLast()) { - return false; - } else { - return true; + try (ResultSet resultSet = executeQuery()) { + if (resultSet.isLast()) { + return false; + } else { + return true; + } } } }