網上mybatis讀取遊標的方法大體都是這樣: html
<select id="selectCarWorkInfo" parameterType="Map" statementType="CALLABLE">
#{result,jdbcType=CURSOR,mode=OUT,javaType=java.sql.ResultSet}
={call fn_get_unit_workinfo_list(
#{unitid,jdbcType=DECIMAL,mode=IN},
#{startTime,jdbcType=VARCHAR,mode=IN},
#{endTime,jdbcType=VARCHAR,mode=IN}
)
}
</select> java
可是我寫入statementType="CALLABLE"後老是報錯: sql
2013-07-24 14:13:13,211 [main] DEBUG [java.sql.Connection] - ooo Connection Opened
2013-07-24 14:13:13,277 [main] ERROR [org.liteframework.core.dao.impl.GenericDaoMyBatis] - nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.lang.ClassCastException: org.apache.ibatis.executor.statement.CallableStatementHandler cannot be cast to org.apache.ibatis.executor.statement.PreparedStatementHandler
### The error may exist in file [D:\eclipseWorkspace\driverBookTrade\build\classes\com\chinaGPS\driverBookTrade\model\mapper\CarWorkInfoMapper.xml]
### The error may involve com.chinaGPS.driverBookTrade.model.pojo.CarWorkInfo.selectCarWorkInfo
### The error occurred while executing a query
### Cause: java.lang.ClassCastException: org.apache.ibatis.executor.statement.CallableStatementHandler cannot be cast to org.apache.ibatis.executor.statement.PreparedStatementHandler; nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.lang.ClassCastException: org.apache.ibatis.executor.statement.CallableStatementHandler cannot be cast to org.apache.ibatis.executor.statement.PreparedStatementHandler
### The error may exist in file [D:\eclipseWorkspace\driverBookTrade\build\classes\com\chinaGPS\driverBookTrade\model\mapper\CarWorkInfoMapper.xml]
### The error may involve com.chinaGPS.driverBookTrade.model.pojo.CarWorkInfo.selectCarWorkInfo
### The error occurred while executing a query
### Cause: java.lang.ClassCastException: org.apache.ibatis.executor.statement.CallableStatementHandler cannot be cast to org.apache.ibatis.executor.statement.PreparedStatementHandler
apache
若去掉該屬性,能夠執行成功,可是不能讀到值。先記錄幾個相關的連接地址: mybatis
http://www.360doc.com/content/12/1019/12/7471983_242394924.shtml(邊緣問題) app
bbs.csdn.net/topics/370015077?page=1(差很少的問題) 框架
http://sishuok.com/forum/blogPost/list/3898.html(實例) eclipse
http://bbs.csdn.net/topics/390345860(貌似已解決,但不能解決個人問題) ui
總結一下:感受與本人項目封裝的框架相關,項目進度優先,先將該問題遺留,待解決。 spa