I am working on a project that has a piece of code like the one below:
String sql = \"SELECT MAX(\" + columnName + \") FROM \" + tableName;
Prepa
Try using the following...
private static final String SQL = "SELECT MAX(%s) FROM %s";
And then using a String.format() call when you use it...
PreparedStatement ps = connection.prepareStatement(String.format(sql,columnName,tableName));
If that doesn't solve the problem, you can always ignore that check; turn it off in your FindBugs configuration.
If that doesn't work (or isn't an option), some IDEs (like IntelliJ) will also let you suprress warnings with either specially formatted comments or annotations.