的IntelliJ IDEA 15.0.2IntelliJ IDEA的解决检查报告
这里是我的代码片段:
public int update(final String sql){
int res = -1;
try (Connection con = this.connect();
Statement pst = con.createStatement()){
res=pst.executeUpdate(sql);//**if write pst.executeUpdate("") than no inspect message**
} catch (final SQLException e) {
this.logger.log(Level.SEVERE,e.getMessage());
}
return res;
}
下面是检查邮件:
电话“的Statement.executeUpdate() '与非恒定参数(短消息)
更多
将调用java.sql.Statement.executeUpdate()或其任何采用动态构造字符串的变体报告为要执行的查询。构造的SQL语句是安全漏洞的常见来源
如何解决它?