gpt4 book ai didi

java - JDBI org.skife.jdbi.v2.exceptions.UnableToCreateStatementException : Exception while binding

转载 作者:行者123 更新时间:2023-12-02 10:30:55 24 4
gpt4 key购买 nike

当我尝试执行下面的代码时, 我收到 UnableToCreateStatementException 异常,原因如下:

java.sql.SQLException:参数索引超出范围(11 > 参数数量,即 10)。

   @SqlUpdate(
"update vehicle_pre_inspection set "
+ "`trip_type`=:trip_type,"
+ "`trip_id`=:trip_id,"
+ "`is_container_sealed`=:is_container_sealed,"
+ "`hidden_lock_present`=:hidden_lock_present,"
+ "`tarpaulin_present`=:tarpaulin_present,"
+ "`cargonet_hooks_present`=:cargonet_hooks_present, "
+ "`floor_tarpaulin_present =:floor_tarpaulin_present`,"
+ "`ceiling_tarpaulin_present=:ceiling_tarpaulin_present`,"
+ "`task_id`=:task_id, "
+ "`last_updated_at`= :lastUpdatedAt, "
+ "`last_updated_by_id`= :lastUpdatedById "
+ " where `id` = :id ")

void update(
@Bind("trip_type") String trip_type,
@Bind("trip_id") Long trip_id,
@Bind("is_container_sealed") Boolean is_container_sealed,
@Bind("hidden_lock_present") Boolean hidden_lock_present,
@Bind("tarpaulin_present") Boolean tarpaulin_present,
@Bind("cargonet_hooks_present") Boolean cargonet_hooks_present,
@Bind("floor_tarpaulin_present") Boolean floor_tarpaulin_present,
@Bind("ceiling_tarpaulin_present") Boolean ceiling_tarpaulin_present,
@Bind("task_id") Long task_id,
@Bind("lastUpdatedAt") Long lastUpdatedAt,
@Bind("lastUpdatedById") Long lastUpdatedById,
@Bind("id") Long id);

最佳答案

检查行: + "floor_tarpaulin_present =:floor_tarpaulin_present,"和 +“ceiling_tarpaulin_present=:ceiling_tarpaulin_present,”

结束克拉 (`) 出现在错误的位置。

关于java - JDBI org.skife.jdbi.v2.exceptions.UnableToCreateStatementException : Exception while binding,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53617752/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com