发帖    主题    评论    推荐    标签    作者    订阅    查搜    注册   登陆   关注
 
面向对象 设计模式 领域驱动设计 企业架构 框架 开发教程 微服务 大数据 扩展性 并发编程 事件驱动 分布式 SOA

itatis 中关于sql的in 语句的问题

2007-10-10 15:14
赞助商链接

<select id="getMiddlewareVO" resultMap="MiddlewareResult" parameterClass="java.util.Map">
<![CDATA[
select common.id,common.middlewarename,common.gatherdate,data.dataname,data.type,data.used,data.total from mware_common common,mware_data data where common.id=data.id and data.type=#type# and common.middlewarename in
<iterate prepend="AND" conjunction="," close=")" open="(" />
#middlewarename[]#
</iterate>
order by common.id,common.gatherdate
]]>
</select>

java代码:
paramsMap.put("type", new Integer(3));
List middlewarename=new ArrayList();
middlewarename.add("IBM-1570");
middlewarename.add("lenovo-2000M");
paramsMap.put("middlewarename", middlewarename)
dao.getMiddleware(paramsMap);

错误如下:(实在不知道是啊什么愿意)

--- The error occurred while preparing the mapped statement for execution.
--- Check the getMiddlewareVO.
--- Check the parameter map.
--- Cause: com.ibatis.common.beans.ProbeException: Error getting ordinal list from JavaBean. Cause java.lang.NumberFormatException: For input string: ""
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:615)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:95)
at com.aspire.ss.watch.middleware.dao.MiddlewareDao.getMiddleware(MiddlewareDao.java:47)
at com.aspire.ss.watch.middleware.dao.MiddlewareDao.main(MiddlewareDao.java:88)
Caused by: com.ibatis.common.beans.ProbeException: Error getting ordinal list from JavaBean. Cause java.lang.NumberFormatException: For input string: ""
at com.ibatis.common.beans.BaseProbe.getIndexedProperty(BaseProbe.java:86)
at com.ibatis.common.beans.ComplexBeanProbe.getProperty(ComplexBeanProbe.java:299)
at com.ibatis.common.beans.ComplexBeanProbe.getObject(ComplexBeanProbe.java:199)
at com.ibatis.common.beans.GenericProbe.getObject(GenericProbe.java:74)
at com.ibatis.sqlmap.engine.exchange.ComplexDataExchange.getData(ComplexDataExchange.java:65)
at com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.getParameterObjectValues(BasicParameterMap.java:132)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:165)
... 7 more
Caused by: java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.ibatis.common.beans.BaseProbe.getIndexedProperty(BaseProbe.java:51)
... 13 more

1
2007-10-11 15:27

>NumberFormatException
这是一个SQL语句输入参数时 数字格式错误。是你的SQL语句有问题,自己单独测试一下。

赞助商链接

赞助商链接

返回顶部

移动版 关于本站 使用帮助 联系管理员 最佳分辨率1366x768
OpenSource JIVEJDON Powered by JdonFramework Code © 2002-20 jdon.com