String sql = "select app_name, file_name, version, xml, md5 from config_file_published " +
"where app_name=? and file_name=?";
List<FilePublished> r = getJdbcTemplate().query(sql, new Object[]{appName, fileName}, new RowMapper<FilePublished>() {
@Override
public FilePublished mapRow(ResultSet rs, int rowNum) throws SQLException {
return new FilePublished(rs.getString(1), rs.getString(2), rs.getInt(3), rs.getString(4), rs.getString(5));
}
});
return !r.isEmpty() ? r.get(0) : null;
}