jdbctemplate count queryForInt and pass multiple parameters
问题 How can I pass multiple parameters in jdbcTemplate queryForInt to get the count. I have tried this, Integer count = this.jdbcTemplate .queryForInt("select count(name) from table_name where parameter1 = ? and parameter2 = ?", new Object[]{parameter1,parameter2}); But its showing queryForInt as strikes. 回答1: Both queryForInt() and queryForLong() are deprecated since version 3.2.2 (correct me if mistake). To fix it, replace the code with queryForObject(String, Class). this.jdbcTemplate