0
在這裏,我爲catname
得到值從參數作爲movie
但在它的數據庫具有對應的值作爲1,對相同音樂 - >圖2,遊戲 - > 3 ....根據爪哇彈簧數據庫轉換參數
"WHERE (\n" +
"\t\t(`Post`.`status` = 1)\n" +
"\t\tAND (`Post`.`postto_id` =\"+catname+\" \")\n" +
"\t\t)" +
"ORDER BY `Post`.`id` desc LIMIT 5", new CrelistMapper());
} catch (Exception e) {
throw e;
}
}
private class CrelistMapper implements ResultSetExtractor<List<Creativity>> {
public List<Creativity> extractData(ResultSet resultSet) throws SQLException {
List<Creativity> crelistList = new ArrayList<Creativity>();
while (resultSet.next()) {
Creativity userObject = new Creativity(resultSet.getString("**postto_id**"),
在這裏我得到了價值作爲電影在「postto_id」我怎麼能將它轉換成1而不是參數電影?