Cause: org.apache.ibatis.binding.BindingException: Parameter 'username' not found异常

# Error querying database.  Cause: org.apache.ibatis.binding.BindingException: Parameter 'username' not found. Available parameters are [arg1, arg0, param1, param2]
### Cause: org.apache.ibatis.binding.BindingException: Parameter 'username' not found. Available parameters are [arg1, arg0, param1, param2]
Disconnected from the target VM, address: '127.0.0.1:65195', transport: 'socket'

如上异常
错误原因:

  • 接口方法里包含多个参数时,使用@Param注解进行标识
  • 在这里插入图片描述
  • 记得添加
  • import org.apache.ibatis.annotations.Param;
  • 依赖
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
这种情况可能是由于对数据库进行查询时,方法内部缺少相应的参数占位符导致的。在持久层(Dao层)的方法中,应该使用@Param注解为每个参数添加占位符,以确保参数能够正确传递。例如,在Lmonkey_CartDao接口中的update方法中,参数quantity应该使用@Param("quantity")进行标注,u_id应该使用@Param("u_id")标注,p_id应该使用@Param("p_id")进行标注。这样就能避免出现"Parameter 'email' not found"的错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Cause: org.apache.ibatis.binding.BindingException: Parameter ‘xx‘ not found.](https://blog.csdn.net/qq_54141095/article/details/124199713)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [数据库疑难杂症 java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the ...](https://download.csdn.net/download/weixin_38717896/13685038)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值