を閉じます。Sonarlintの倍数は、このコードで
Connection connection = null;
PreparedStatement req = null;
try {
connection = DriverManager.getConnection(url, user, password);
req = connection.prepareStatement(SQL);
} finally {
if (connection != null) {
connection.close();
}
if (req != null) {
req.close();
}
}
SonarLintは言う:
は5行目(
req = ...
)の "最終的に" 句で、この "PreparedStatementを" 閉じ
そして、私が閉じるときreq
最初:
は
がどのように私はSonarLintを幸せにすることができます(connection = ...
)4行目に「ついに」句で、この「接続」を閉じますか?