org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘arg0’, mode=IN, javaType=class java.lang.Object, 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: 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).

The error may exist in com/atguigu/mybatis/mapper/ParameterMapper.xml

The error may involve defaultParameterMap

The error occurred while setting parameters

SQL: – select * from t_user where username =? and age =?; select * from t_user where username = ‘ad’ and sex = ‘男’;

Cause: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘arg0’, mode=IN, javaType=cla

出现了这个问题,刚开始以为是sql语句写错了,就一直在加空格或者减空格,最后发现是注释的问题


在灰色的select那行,是我按键盘ctrl+alt+?来进行idea软件的默认注释的,本以为这样也算是在xml中的注释,结果并不是,当把这种注释用手动注释起来时候


程序运行正常,说明在xml文件里面并不能使用快捷键进行注释。

MyBatis中PersistenceException:Error querying database. Cause: org.apache.ibatis.type.TypeException:相关推荐

  1. org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.

    在xml文件中碰到这样的报错的时候,有可能是你在里面使用了这种注释,编译会报错,可能这就是约定大于配置 org.apache.ibatis.exceptions.PersistenceExceptio ...

  2. Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: There is no gette

    这里写自定义目录标题 问题起因 错误码代码如下: step 1 问题起因 很简单的id和where mapper标签的使用不知道为什么突然出现无null1getter错误 错误码代码如下: org.a ...

  3. ssm中报错: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type a

    错误:Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ...

  4. Mybatis报错: Error querying database. Cause: java.lang.NumberFormatException: For input string: “A“

    报错信息:Error querying database. Cause: java.lang.NumberFormatException: For input string: "A" ...

  5. Mybatis使用之 Caused by: org.apache.ibatis.type.TypeException: Could not resolve type alias‘User’

    注意错误提示,是在UserMapper.xml中出现的问题,自己检查后并没有发现问题. 从Mybatis官网文档中,找到select标签的下面两个属性的区别,将resultType换成resultMa ...

  6. org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException:

    解决: 1 在SQL语句中使用#{name,jdbcType=VARCHAR} ​指定JDBC类型 错误的: 修改后的:

  7. 【Mybatis】报错:org.apache.ibatis.type.TypeException: The alias 'Collection' is already mapp

    jar包有同类名,冲突了.加个别名就好了 import org.apache.ibatis.type.Alias; @Alias("tb_collection") public c ...

  8. Error querying database.Parameter ‘brandName‘ not found. Available parameters are [size, param3...]

    项目场景: 提示:黑马新版web项目,增删改查的条件查询 问题描述: 连接数据库失败,一开始以为是mybatis的原因,后面发现是xml配置sql语法问题 问题关键字:parameter 'xxxxx ...

  9. 初学MyBatis(踩坑)Error querying database.

    最近在学习Mybatis,代码全部根据教程写好了,一运行结果报了一个错误,主要错误内容: Caused by: org.apache.ibatis.exceptions.PersistenceExce ...

最新文章

  1. 四条使用Spring BeanUtils的总结,避免各种诡异的属性拷贝问题!
  2. boost::EccentricityProperty用法的测试程序
  3. 发现一个病毒文件你删了他又自动创建怎么解决
  4. 数据库流行度11月排行榜:Oracle 意外滑落和 PostgreSQL 再创新高
  5. Django一些常用操作记录
  6. Windows Live Writer 代码插件改造
  7. 旷视科技完成4.6亿美元C轮融资,再破AI融资记录 | 聚焦
  8. 关于explain plan的使用!
  9. ACL(访问控制列表)
  10. iatf16949标准三大过程_IATF16949要求的过程、文件、记录汇总
  11. 怎样用html设置文档格式,Dreamweaver使用CSS样式表设置网页文本格式
  12. GPRS模块中AT指令发送短信的PDU编码规则
  13. Oracle dblink 数据库同步
  14. 预定义类型未定义或导入_【小程序】商家来看看,常见的微信小程序类型有哪些?...
  15. 2.1 Mybatis——log4j日志文件应用
  16. 韦伯/瑞利/指数分布
  17. 政考网:公考报班到底靠不靠谱
  18. 亚信科技Java实习生(大三)面试
  19. 原来,这就是以太坊3.0的样子
  20. 常用的手机号,身份号正则校验

热门文章

  1. python ctypes模块安装_ctypes模块扩展python
  2. python requests cookie_Python requests模块cookie实例解析
  3. workerman events.php,workerman安装event扩展的方法介绍
  4. python 宏处理库_常用的Python库,给大家分享一下!
  5. 2021-03-07 Nussbaum函数
  6. Excel中文字换行
  7. centos 6.5升级openssl
  8. 解决Android Studio编译后安装apk报错:Error while Installing APK
  9. 第二章:2.6 使用 runserver 命令把项目运行起来
  10. JS组件系列——自己动手扩展BootstrapTable的 冻结列 功能:彻底解决高度问题