@Override public int updateModule(Module module) { // TODO Auto-generated method stub String sqlStr = "update " + TABLE_NAME + " SET " + MODULE_NAME + "=?," + ENABLE + "=?," + PICTURE + "=?," + TARGET + "=? WHERE " + ID + "=?"; Object[] obj = { module.getModuleName(), module.getEnable(), module.getPicture(), module.getTarget(), module.getId() }; return jdbcTemplate.update(sqlStr, obj); }
@Override public int insertModule(Module module) { // TODO Auto-generated method stub String sqlStr = "insert into " + TABLE_NAME + " (" + MODULE_NAME + "," + ENABLE + "," + PICTURE + "," + TARGET + ") VALUES(?,?,?,?)"; Object[] obj = { module.getModuleName(), module.getEnable(), module.getPicture(), module.getTarget() }; return jdbcTemplate.update(sqlStr, obj); }