zoukankan      html  css  js  c++  java
  • myBatis的binding错误:Invalid bound statement (not found)

    org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
    这个问题我找了好久,终于找到了
    正确的写法:
    <select id="getEmpByIdAndLastName" resultType="com.atguigu.mybatis.bean.Employee">
    select id, last_name, gender, email from tbl_employee where id = #{id} and last_name = #{last_name}
    </select>
    错误的写法:
    <select id="getEmpByIdAndLastName" resultType="com.atguigu.mybatis.bean.Employee">
    select * from tbl_employee where id = #{id} and last_name = #{last_name}
    </select>


    Mapped Statements collection does not contain value for com.atguigu.mybatis.dao.DeparmentMapper.getDeptById

    Cause: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='__frch_emp_0.last_name', mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).

  • 相关阅读:
    树的递归
    《计算机存储与外设》 3二级存储器
    《计算机存储与外设》 2主存储器
    《码农翻身:用故事给技术加点料》阅读有感
    分析"傍富婆发财"
    《第22条军规》Catch-22
    《编译原理》4
    《编译原理》3
    《血酬定律》
    linux下netcore程序部署
  • 原文地址:https://www.cnblogs.com/zjulanjian/p/9194895.html
Copyright © 2011-2022 走看看