首页 新闻 赞助 找找看

stuts+spring+ibats框架的应用问题

0
[已解决问题] 解决于 2013-06-09 11:43

遇到的问题是我在页面里添加了一个可以选择的日期(时间框),但是选择过日期之后,出现的问题是

ERROR com.txkj.business.inform.dao.BMInformDao - org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in config/ibatis/BMInform.xml.
--- The error occurred while applying a result map.
--- Check the getBMInform-AutoResultMap.
--- Check the result mapping for the 'INFOR_TIME' property.
--- Cause: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.NumberFormatException: For input string: " 02"; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in config/ibatis/BMInform.xml.
--- The error occurred while applying a result map.
--- Check the getBMInform-AutoResultMap.
--- Check the result mapping for the 'INFOR_TIME' property.
--- Cause: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.NumberFormatException: For input string: " 02"
2013-06-07 17:48:08,763 [http-8080-1] ERROR com.txkj.business.inform.action.BMInformAction - getBMInform error:java.lang.Exception: org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in config/ibatis/BMInform.xml.
--- The error occurred while applying a result map.
--- Check the getBMInform-AutoResultMap.
--- Check the result mapping for the 'INFOR_TIME' property.
--- Cause: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.NumberFormatException: For input string: " 02"; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in config/ibatis/BMInform.xml.
--- The error occurred while applying a result map.
--- Check the getBMInform-AutoResultMap.
--- Check the result mapping for the 'INFOR_TIME' property.
--- Cause: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.NumberFormatException: For input string: " 02"

有人说是这个'INFOR_TIME'的类型有问题,我在实体类里定义的类型为date,它默认读取出来的是一串字符串,即:Fri Jun 07 17:52:00 CST 2013

什么原因呢?

lichen辰的主页 lichen辰 | 初学一级 | 园豆:196
提问于:2013-06-07 18:02
< >
分享
最佳答案
0

类里定义的类型为date ?那你都说了读取出来是字符串啊!需要转换的!

奖励园豆:5
Beyond-bit | 老鸟四级 |园豆:2885 | 2013-06-07 19:04
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册