67,513
社区成员
发帖
与我相关
我的任务
分享
Bicycle bicycle=new Bicycle();
bicycle.setBicycleId(Integer.parseInt(bicycleId));
bicycle.setCardCode(cardCode);
bicycle.setStatus(1);
bicycle.setPileId(null);
bicycle.setStationId(null);
bicycleServiceImpl.updateBicycleCardCode(bicycle);
<update id="updateBicycleCardCode" parameterType="com.abc.bicycle.model.Bicycle">
update
bicycle
set
card_code=#{cardCode},
status=#{status},
station_id=#{stationId},
pile_id=#{pileId},
where
bicycle_id=#{bicycleId}
</update>
org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #3 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型
update bicycle set status=1,pile_id=null,station_id=null where bicycle_id=39
<update id="updateBicycleCardCode" parameterType="com.abc.bicycle.model.Bicycle">
update
bicycle
set
card_code=#{cardCode},
status=#{status},
station_id=#{stationId,jdbcType=INTEGER},
pile_id=#{pileId,jdbcType=INTEGER}
where
bicycle_id=#{bicycleId}
</update>