错误信息:
Could not set parameters for mapping: ParameterMapping{property='goodsImgId', 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: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
sql语句:
@Insert("INSERT INTO goodsimg(goodsImgId,goodsImgName) VALUE ('#{goodsImgId}','#{goodsImgName}');")
解决方法:
方法一:注释问题,无注释,排除
方法二:添加类型,#{goodsImgId,jdbcType=VARCHAR},无用
方法三:错误原因,手贱给参数添加单引号
正确:@Insert("INSERT INTO goodsimg(goodsImgId,goodsImgName) VALUE (#{goodsImgId},#{goodsImgName});")
错误:@Insert("INSERT INTO goodsimg(goodsImgId,goodsImgName) VALUE ('#{goodsImgId}','#{goodsImgName}');")
ps:正常的sql添加语句时,也要添加单引号,所以之前测试sql语句时,测试不出错误,手贱啊。
SpringBoot: failed to extract parameter names for org.apache.ibatis.mapping.ParameterMapping
spring boot
oracle: jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型: 1111
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='pxh', mode=IN, javaType=class java
python 读文件结束 python文件读操作方法read
目录一、读取整个文件1. with方式2. open方式3. open()函数和with open()的异同点4. 文件路径5. 读取文件常用的三种方法的区别二、文件的写入一、读取整个文件读取文件主要用到两个方式,即:1. with方式 with open('文件名') as file_object:
contents = file_object.read()
#表示逐行读取