的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語句是安全漏洞的常見來源
如何解決它?