ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luciano Giavedoni <lgiaved...@itesa.com.ar>
Subject Store procedure
Date Tue, 01 Feb 2005 20:27:41 GMT
Hi:
I have a problen when i call a store procedure whith ibatis.
The store procedure is only for testing and the source is:

CREATE PROCEDURE ptest2
(@a varchar(20) output,
 @b varchar(20) 
)
as
set @a=@b
go

The xml code is:

<parameterMap id="mapeo" class="map" >
      <parameter property="a" jdbcType="VARCHAR" javaType="java.lang.String" mode="OUT"/>
      <parameter property="b" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>
</parameterMap>

<procedure id="ptest2"  parameterMap="mapeo" >
       {? = call ptest2 (?) }
</procedure>

And the java source is:
try{Map m;
      m=new HashMap();
      m.put("a",null);
      m.put("b","fsee");
      client.queryForObject("ptest2",m);
    }
catch(Exception ex)
	 {System.out.println(ex.getMessage());
	  ex.printStackTrace(System.out);
	  }

The aplication throws this exception:
--- The error occurred in ibatis/procedure/Procedures.xml.  
--- The error occurred while executing update procedure.  
--- Check the {? = call ptest2 (?) }.  
--- Check the output parameters (register output parameters failed).  
--- Cause: java.sql.SQLException: Procedure return value is integer.
com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in ibatis/procedure/Procedures.xml.  
--- The error occurred while executing update procedure.  
--- Check the {? = call ptest2 (?) }.  
--- Check the output parameters (register output parameters failed).  
--- Cause: java.sql.SQLException: Procedure return value is integer.
Caused by: java.sql.SQLException: Procedure return value is integer.
	at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:72)
	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:230)
	at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:57)
	at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:34)
	at ar.org.ubp.ecogas.dao.ProcedureDao.test2(ProcedureDao.java:55)
	at ar.org.ubp.ecogas.service.ProcedureService.test2(ProcedureService.java:28)
	at iguUsuario.AppFrame.<init>(AppFrame.java:147)
	at iguUsuario.AppFrame.teInstancio(AppFrame.java:153)
	at iguUsuario.AppFrame.main(AppFrame.java:161)

What is hapen???
Some body can help me???

Thanks
Luciano
	
	

	
	
	


Mime
View raw message