final boolean someCondition = ...
final String sql1 = ...
final String sql2 = ...
final String sql = someCondition ? sql1 : sql2;
Connection conn = ...
PreparedStatement stmt;
try {
stmt = conn.prepareStatement(sql); // "Use a variable mechanism to construct..."
} catch (SQLException e) {
...
} finally {
...
}
--
Important: this SonarLint Google Group will close on June 11th, 2018, in order to move to a new forum to power even more community discussions. See details in this post: https://groups.google.com/d/msg/sonarlint/7mRg447YjWM/yk64X5HyAQAJ
---
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/59f706ab-08e3-4f67-a75d-01f4d62c4349%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.