- 浏览: 539230 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (339)
- JavaBase (27)
- J2EE (70)
- Database (22)
- Spring (3)
- struts1.x (6)
- struts2.x (16)
- Hibernate (10)
- IBatis (4)
- DWR (1)
- SSH (5)
- Oracle (31)
- HTML (12)
- javascript (11)
- Thinking (3)
- Workflow (5)
- Live (13)
- Linux (23)
- ExtJS (35)
- flex (10)
- php (3)
- Ant (10)
- ps (1)
- work (2)
- Test (1)
- Regular Expressions (2)
- HTTPServer (2)
- 方言 (1)
- 生活 (2)
- Sybase PowerDesigner (0)
最新评论
-
mikey_5:
非常感谢楼主的分享,<parameter propert ...
Check the output parameters (register output parameters failed) IN Ibatis -
影子_890314:
我现在也有这个错误,求解!
Check the output parameters (register output parameters failed) IN Ibatis -
358135071:
学习了,感谢分享!
使用hibernate 代替 mysql 中 limit 進行分頁 -
wjpiao:
你下面的“正确的映射”里面不是还是有number类型吗?
Check the output parameters (register output parameters failed) IN Ibatis -
zh_s_z:
很有用!弄一份吧!
Oracle数据库分区表操作方法
Check the output parameters (register output parameters failed) IN Ibatis
- 博客分类:
- IBatis
使用IBatis 在调用Oracle 的存储过程 或者 函数时出现以下异常, 内容如下:
-----------------------------------------------------------------------------------------------
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [17004];
--- The error occurred in ibatis-conf/MpsBillPayMainBean.xml.
--- The error occurred while executing query procedure.
--- Check the {?=call jtosa_fun_billpaymainlistcount(?,?,?)}.
--- Check the output parameters (register output parameters failed).
--- Cause: java.sql.SQLException: 无效的列类型; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in ibatis-conf/MpsBillPayMainBean.xml.
--- The error occurred while executing query procedure.
--- Check the {?=call jtosa_fun_billpaymainlistcount(?,?,?)}.
--- Check the output parameters (register output parameters failed).
--- Cause: java.sql.SQLException: 无效的列类型
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212)
at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithMapResult(SqlMapClientTemplate.java:260)
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForMap(SqlMapClientTemplate.java:372)
at com.jtosa.dao.impl.BillPayMainDaoImpl.findBillPayMainListCount(BillPayMainDaoImpl.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy11.findBillPayMainListCount(Unknown Source)
at com.jtosa.service.impl.BillPayMainServiceImpl.searchBillPayMainListCount(BillPayMainServiceImpl.java:20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy30.searchBillPayMainListCount(Unknown Source)
at com.jtosa.service.impl.test.BillPayMainServiceImplTest.testSearchBillPayMainListCount(BillPayMainServiceImplTest.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in ibatis-conf/MpsBillPayMainBean.xml.
--- The error occurred while executing query procedure.
--- Check the {?=call jtosa_fun_billpaymainlistcount(?,?,?)}.
--- Check the output parameters (register output parameters failed).
--- Cause: java.sql.SQLException: 无效的列类型
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:201)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForMap(SqlMapExecutorDelegate.java:658)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForMap(SqlMapExecutorDelegate.java:640)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForMap(SqlMapSessionImpl.java:148)
at org.springframework.orm.ibatis.SqlMapClientTemplate$7.doInSqlMapClient(SqlMapClientTemplate.java:374)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:209)
... 47 more
Caused by: java.sql.SQLException: 无效的列类型
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.OracleStatement.getInternalType(OracleStatement.java:3424)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterInternal(OracleCallableStatement.java:125)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:268)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:348)
at com.mchange.v2.c3p0.impl.NewProxyCallableStatement.registerOutParameter(NewProxyCallableStatement.java:311)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.registerOutputParameters(SqlExecutor.java:431)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQueryProcedure(SqlExecutor.java:274)
at com.ibatis.sqlmap.engine.mapping.statement.ProcedureStatement.sqlExecuteQuery(ProcedureStatement.java:39)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189)
... 55 more
----------------------------------------------------------------------------------------------------
错误原因是:数据类型不正确.
<parameterMap class="java.util.HashMap" id="listparamMap">
<parameter property="skipSize" javaType="java.lang.Integer" jdbcType="NUMBER" mode="IN"/>
<parameter property="pageSize" javaType="java.lang.Integer" jdbcType="NUMBER" mode="IN"/>
<parameter property="payTime" javaType="java.lang.String" jdbcType="VARCHAR2" mode="IN"/>
<parameter property="payEndTime" javaType="java.lang.String" jdbcType="VARCHAR2" mode="IN"/>
<parameter property="cityCode" javaType="java.lang.String" jdbcType="VARCHAR2" mode="IN"/>
<parameter property="u_cursor" javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR
" mode="OUT"/>
</parameterMap>
<parameterMap class="java.util.HashMap" id="paramMap">
<parameter property="total" jdbcType="NUMBER
" javaType="java.lang.Long" mode="OUT"/>
<parameter property="payTime" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
<parameter property="payEndTime" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
<parameter property="cityCode" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
</parameterMap>
<procedure id="findBillPayMainListCount" parameterMap="paramMap" resultClass="java.lang.Long">
{?=call jtosa_fun_billpaymainlistcount(?,?,?)}
</procedure>
<procedure id="findBillPayMainList" parameterMap="listparamMap" resultMap="BillPayMainBean">
{call jtosa_porc_billPayMainList(?,?,?,?,?,?)}
</procedure>
----------------------------------------------------------------------------------
NUMBER 是oracle 数据库中的数据类型,但是在java.sql.Types 中并没有些常量.
只要将NUMBER 替换成java.sql.Types 中存在即可.
setType("ARRAY", Types.ARRAY);
setType("BIGINT", Types.BIGINT);
setType("BINARY", Types.BINARY);
setType("BIT", Types.BIT);
setType("BLOB", Types.BLOB);
setType("BOOLEAN", JDBC_30_BOOLEAN);
setType("CHAR", Types.CHAR);
setType("CLOB", Types.CLOB);
setType("DATALINK", JDBC_30_DATALINK);
setType("DATE", Types.DATE);
setType("DECIMAL", Types.DECIMAL);
setType("DISTINCT", Types.DISTINCT);
setType("DOUBLE", Types.DOUBLE);
setType("FLOAT", Types.FLOAT);
setType("INTEGER", Types.INTEGER);
setType("JAVA_OBJECT", Types.JAVA_OBJECT);
setType("LONGVARBINARY", Types.LONGVARBINARY);
setType("LONGVARCHAR", Types.LONGVARCHAR);
setType("NULL", Types.NULL);
setType("NUMERIC", Types.NUMERIC);
setType("OTHER", Types.OTHER);
setType("REAL", Types.REAL);
setType("REF", Types.REF);
setType("SMALLINT", Types.SMALLINT);
setType("STRUCT", Types.STRUCT);
setType("TIME", Types.TIME);
setType("TIMESTAMP", Types.TIMESTAMP);
setType("TINYINT", Types.TINYINT);
setType("VARBINARY", Types.VARBINARY);
setType("VARCHAR", Types.VARCHAR);
setType("CH", Types.CHAR);
setType("VC", Types.VARCHAR);
setType("DT", Types.DATE);
setType("TM", Types.TIME);
setType("TS", Types.TIMESTAMP);
setType("NM", Types.NUMERIC);
setType("II", Types.INTEGER);
setType("BI", Types.BIGINT);
setType("SI", Types.SMALLINT);
setType("TI", Types.TINYINT);
setType("DC", Types.DECIMAL);
setType("DB", Types.DOUBLE);
setType("FL", Types.FLOAT);
setType("ORACLECURSOR", -10);
-----------------------------------------------------------------------------
看到ORACLECURSOR 你也许会得到什么启示.......... (看下IBatis Bean 的 映射文件)
正确的映射:
<parameterMap class="java.util.HashMap" id="listparamMap">
<parameter property="skipSize" javaType="java.lang.Integer" jdbcType="NUMBER" mode="IN"/>
<parameter property="pageSize" javaType="java.lang.Integer" jdbcType="NUMBER" mode="IN"/>
<parameter property="payTime" javaType="java.lang.String" jdbcType="VARCHAR2" mode="IN"/>
<parameter property="payEndTime" javaType="java.lang.String" jdbcType="VARCHAR2" mode="IN"/>
<parameter property="cityCode" javaType="java.lang.String" jdbcType="VARCHAR2" mode="IN"/>
<parameter property="u_cursor" javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR" mode="OUT"/>
</parameterMap>
<parameterMap class="java.util.HashMap" id="paramMap">
<parameter property="total" javaType="java.lang.Long" jdbcType="DOUBLE" mode="OUT"/>
<parameter property="payTime" javaType="java.lang.String" jdbcType="VARCHAR2" mode="IN"/>
<parameter property="payEndTime" javaType="java.lang.String" jdbcType="VARCHAR2" mode="IN"/>
<parameter property="cityCode" javaType="java.lang.String" jdbcType="VARCHAR2" mode="IN"/>
</parameterMap>
<procedure id="findBillPayMainListCount" parameterMap="paramMap" resultClass="java.lang.Long">
{?=call jtosa_fun_billpaymainlistcount(?,?,?)}
</procedure>
<procedure id="findBillPayMainList" parameterMap="listparamMap" resultMap="BillPayMainBean">
{call jtosa_porc_billPayMainList(?,?,?,?,?,?)}
</procedure>
评论
jdbcType="DOUBLE" mode="OUT" /> 原来要使用Double,谢谢
发表评论
-
IBatis Tools Abator
2010-10-10 23:03 1087IBatis tools address: http: ... -
Could not find SQL statement to include with refid 'employee.abatorgenerated_Exa
2010-10-10 19:05 6622Spring2.5 + IBatis (abator code ... -
IBatis调用ORACLE的存储过程、函数的返回结果集例子
2009-10-11 22:24 2899/****************************** ...
相关推荐
ibatis in action 中文版3ibatis in action 中文版3ibatis in action 中文版3ibatis in action 中文版3
根据提供的信息来看,这里主要涉及的是《ibatis in action》这本书的相关内容分享。不过由于描述与部分内容中的信息并不完整,且存在乱码情况,我们难以直接从中提取具体的知识点。因此,下面将围绕《ibatis in ...
《IBATIS_IN_ACTION》是一本深度探讨iBATIS框架应用与实践的专业书籍,由Clinton Begin、Brandon Goodin和Larry Meadors共同编写。本书详细介绍了iBATIS这一流行开源框架的核心概念、工作原理以及在实际项目中的应用...
《iBATIS in Action》是一本专注于讲解iBATIS框架使用的专业书籍,它为开发者提供了深入浅出的指导,帮助他们有效地在项目中应用这一强大的持久层解决方案。iBATIS,一个由Apache软件基金会维护的开源项目,是Java...
《iBatis in Action》是一本专为Java开发者编写的权威指南,深入讲解了iBatis和MyBatis这两个流行的持久层框架。这本书通过实践案例,详细阐述了如何有效地使用iBatis进行数据库操作,以及如何平滑过渡到MyBatis,...
那么iBatis作者编著的这本《iBatis in Action》是最好的选择了!至于下载资源则是原著引进中国之后出版的官方中文版,大大的方便大家阅读,学习!完整的资源是91.6M,格式为pdf。值得下载! 因为较大所以分成了两个...
iBATIS in Action中文版(iBATIS实战 有水印) 第三部分
在网上一个牛人翻译的ibatis in action,他分成了几个内容来翻译,我感觉不错,就把各部分分开弄成了word格式,还没翻译完,但是现有的翻译的部分就值得我们研究了。很适用的东西,还附带有代码。大家看看
Manning.iBATIS.in.Action.Jan.2007.eBook-BBL.pdf MyBatis 3 User Guide Simplified Chinese.pdf MyBatis-3.0.3-Migrations.pdf MyBatis-3.0.3-User-Guide.pdf MyBatis-3-Migrations.doc MyBatis-3-Migrations.pdf ...
一共七个分卷 iBATIS in Action中文版(iBATIS实战 有水印) 第一部分
ibatis in action 中文版4ibatis in action 中文版4ibatis in action 中文版4ibatis in action 中文版4
ibatis in action 中文版1ibatis in action 中文版1ibatis in action 中文版1
### ibatis3.0中`in`的用法详解 #### 一、引言 在进行数据库查询时,经常会遇到需要根据多个值进行查询的情况,这时`IN`语句就显得尤为重要。`IN`语句可以用于判断某个字段的值是否在一个指定的列表之中,非常适用...
Ibatis 是一款轻量级的Java持久层框架,它允许开发者将SQL语句与Java代码分离,从而使得数据库访问更加灵活、易于维护。本篇文章将深入探讨Ibatis的核心概念、最佳实践以及与其他框架如Struts和Spring的整合。 1. ...
ibatis实战中文版 一共2个文件 ibatis in action
《iBatis in Action》是一本专注于iBatis框架的权威指南,中文版虽然未完成,但已经提供了宝贵的中文学习资料。iBatis是Java世界里一个流行的数据访问层(Data Access Layer)框架,它旨在简化数据库操作,将SQL与...
ibatis in action 中文版2ibatis in action 中文版2
《Manning iBATIS in Action》是一本专为Java开发者设计的权威指南,全面深入地介绍了iBATIS这一持久层框架。iBATIS是Java世界中一个流行的数据访问框架,它将SQL映射与对象模型相结合,简化了数据库操作,提高了...
ibatis实战中文版 一共2个文件 ibatis in action
根据提供的文件信息,我们可以从《ibatis in action》这本电子书中提炼出多个与iBATIS框架相关的知识点。以下是对这些知识点的详细说明: ### 一、iBATIS概述 **标题**: "Manning Ibatis In Action Jan 2007 Ebook...