问题描述
- db2报错求大神解决,在线等到明天
-
严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'systemInfoCache' defined in class path resource [config/core.xml]: Invocation of init method failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [-4220];--- The error occurred in config/sql-mapping/coreSql.xml.
--- The error occurred while applying a result map.
--- Check the core.sysInfoList.
--- Check the result mapping for the 'name' property.
--- Cause: com.ibm.db2.jcc.a.SqlException: [jcc][t4][10199][10462][4.2.73] 必需的字符转换器不可用。 ERRORCODE=-4220, SQLSTATE=null; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in config/sql-mapping/coreSql.xml.
--- The error occurred while applying a result map.
--- Check the core.sysInfoList.
--- Check the result mapping for the 'name' property.
--- Cause: com.ibm.db2.jcc.a.SqlException: [jcc][t4][10199][10462][4.2.73] 必需的字符转换器不可用。 ERRORCODE=-4220, SQLSTATE=null
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [-4220];--- The error occurred in config/sql-mapping/coreSql.xml.
--- The error occurred while applying a result map.
--- Check the core.sysInfoList.
--- Check the result mapping for the 'name' property.
--- Cause: com.ibm.db2.jcc.a.SqlException: [jcc][t4][10199][10462][4.2.73] 必需的字符转换器不可用。 ERRORCODE=-4220, SQLSTATE=null; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in config/sql-mapping/coreSql.xml.
--- The error occurred while applying a result map.
--- Check the core.sysInfoList.
--- Check the result mapping for the 'name' property.
--- Cause: com.ibm.db2.jcc.a.SqlException: [jcc][t4][10199][10462][4.2.73] 必需的字符转换器不可用。 ERRORCODE=-4220, SQLSTATE=null
com.ibatis.common.jdbc.exception.NestedSQLException:--- The error occurred in config/sql-mapping/coreSql.xml.
--- The error occurred while applying a result map.
--- Check the core.sysInfoList.
--- Check the result mapping for the 'name' property.
Java代码: public class SystemInfoCache { public void init(){ sysInfoCacheMap = new HashMap(); List sysList = sqlMapExecutor.queryForList("core.querySysInfoList"); for(int i=0;i<sysList.size();i++){ Map sysMap = (Map)sysList.get(i); sysInfoCacheMap.put(sysMap.get("name"), sysMap.get("value")); } } public void setSqlMap(SqlMapClientOperations sqlmapclientoperations) { this.sqlMapExecutor = sqlmapclientoperations; } private SqlMapClientOperations sqlMapExecutor; public static Map sysInfoCacheMap; }
<resultMap class="java.util.HashMap" id="sysInfoList"> <result property="name" column="name"/> <result property="value" column="valueOf"/> </resultMap> <select id="querySysInfoList" resultMap="sysInfoList"> select name,valueOf from ocs_sysinfo </select>
解决方案
http://blog.csdn.net/ding43930053/article/details/9669335
解决方案二:
--- The error occurred in config/sql-mapping/coreSql.xml.
这个错误发生在config/sql-mapping/coreSql.xml文件中
--- The error occurred while applying a result map.
在进行结果映射时产生的
--- Check the core.sysInfoList.
检查core.sysInfoList
--- Check the result mapping for the 'name' property.
检查name属性的映射
但以下文章提供了完全不同的解决思路:
http://blog.sina.com.cn/s/blog_5c0522dd0100fz8p.html
http://blog.csdn.net/thc1987/article/details/7217733