Cause: java.sql.SQLException: 列の型が無効です。这个问题是因为sqlmap中的 “jdbcType = "CHAR” char这个类型和 insert 这个 sql文 中的类型不一致 所造成的, 我的就写成了 varchar2这个类型,搞得我弄了很长的时间没有做对,主要是我写test测试是为他们测试的,所以这个类型问题没有看出来,怎么测试也不成功,现在可以了,呵呵!Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in keijo/common/data/dao/SeisangakuDaoImpl.xml.
--- The error occurred while applying a result map.
--- Check the SeisangakuDaoImpl.SeisangakuResult.
--- Check the result mapping for the 'tesuRyoPerS' property.
--- Cause: java.sql.SQLException: 列名が無効です。
Caused by: java.sql.SQLException: 列名が無効です。
这个错误是resultMap 中的字段数目 和 select 语句中的 字段的数目应该是 相等的,或者select语句中的字段的数目大于resultMap中的字段数目也是可以,还有不匹配的话也会出错,这个是不匹配出错的。这个只是这个错误提示的一个解决的办法,继续总结。()
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is already a statement named SeisangakuDaoImpl.sumSeisanIchiran in this SqlMap.
Caused by: com.ibatis.sqlmap.client.SqlMapException: There is already a statement named SeisangakuDaoImpl.sumSeisanIchiran in this SqlMap. 这个是因为在 sqlmap中放置了两个id 名字相同的sql文。删除一个就可以了。
select 0 num from tab 前面的零我以前没有见过,这个语法从在oracle运行的结果来看, 这个零 可以变成任何的数字 然后选择出来的就是你变成的数据,当然,是数字类型还是 char 类型 要看 num 这个 应该是 num是char的话就可以 前面就是 写成字母了,然后数据库中的数据会变成你赋的值。有人会的请指导一下谢谢!
我们做这个项目是用xls表和数据库交换了进行的,要进行初始化,对比什么,就是说在xls表里填写数据,好处是你自己写的xls是自己的数据每次运行都是自己的数据,别人运行时别人的数据,这样就不会互相影响,不过也有缺陷,运行的时候xls有时候会出错,并且莫名其妙,今天发现了一个错误,老是说是这个字段是空值,解决办法是在其他的表里要是也有这个字段的话,并且他没有报错,你就在xls sheet表里把这个字段复制到提示有null的那个sheet里面就可以运行了,实现不行那就从建立xls表开始做起。
--- The error occurred in keijo/common/data/dao/SeisangakuDaoImpl.xml.
--- The error occurred while applying a result map.
--- Check the SeisangakuDaoImpl.SeisangakuResult.
--- Check the result mapping for the 'tesuRyoPerS' property.
--- Cause: java.sql.SQLException: 列名が無効です。
Caused by: java.sql.SQLException: 列名が無効です。
这个错误是resultMap 中的字段数目 和 select 语句中的 字段的数目应该是 相等的,或者select语句中的字段的数目大于resultMap中的字段数目也是可以,还有不匹配的话也会出错,这个是不匹配出错的。这个只是这个错误提示的一个解决的办法,继续总结。()
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: There is already a statement named SeisangakuDaoImpl.sumSeisanIchiran in this SqlMap.
Caused by: com.ibatis.sqlmap.client.SqlMapException: There is already a statement named SeisangakuDaoImpl.sumSeisanIchiran in this SqlMap. 这个是因为在 sqlmap中放置了两个id 名字相同的sql文。删除一个就可以了。
select 0 num from tab 前面的零我以前没有见过,这个语法从在oracle运行的结果来看, 这个零 可以变成任何的数字 然后选择出来的就是你变成的数据,当然,是数字类型还是 char 类型 要看 num 这个 应该是 num是char的话就可以 前面就是 写成字母了,然后数据库中的数据会变成你赋的值。有人会的请指导一下谢谢!
我们做这个项目是用xls表和数据库交换了进行的,要进行初始化,对比什么,就是说在xls表里填写数据,好处是你自己写的xls是自己的数据每次运行都是自己的数据,别人运行时别人的数据,这样就不会互相影响,不过也有缺陷,运行的时候xls有时候会出错,并且莫名其妙,今天发现了一个错误,老是说是这个字段是空值,解决办法是在其他的表里要是也有这个字段的话,并且他没有报错,你就在xls sheet表里把这个字段复制到提示有null的那个sheet里面就可以运行了,实现不行那就从建立xls表开始做起。