I have a query:
Date dDateFrom;
...
String sql = "select a from tblA where timestamp > ?";
ps = this.connection.prepareStatement(sql);
ps.setTimestamp(1, java.sql.Timestamp(dDateFrom.getTime()));
And the IntelliJ IDE warn an Error: cannot resolve query parameter, I believe it's because the column "timestamp", (I know it's a bad name, but it's defined decade ago, I can not change it).
Anyway I can ignore this error?
Navigate over the part of the code where the error is highlighted, hit ALT+ENTER and select Inspection 'Unresolved queries and query parameter' options -> Edit inspection profile settings. This will open settings dialog where you can uncheck this inspection so that future "errors" of this kind will be ignored.
You can also change it directly from Settings. Just search for Unresolved query.
Btw: this inspection is shown as a JPA inspection, but clearly it works for plain JDBC too.
You might be able to avoid the warning by quoting the column name with double-quotes, backticks, or brackets. This is the usual SQL mechanism for allowing unusual column names such as spaces or reserved words, and could help IntelliJ parse it better.
String sql = "select a from tblA where \"timestamp\" > ?";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With