ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Park <yjac...@paran.com>
Subject How to get a result from output parameter(SYS_REFCURSOR) in iBATIS 3(by using annotation)
Date Thu, 22 Apr 2010 14:50:06 GMT
Hi there,

How to get a result from output parameter(oracle cursor).
Below is my code and that is not work.
Does anyone can help me?


Oracle Stored Procedure:

CREATE OR REPLACE PROCEDURE getProducts
(
   rs OUT SYS_REFCURSOR
)
IS
BEGIN
   OPEN rs FOR
   SELECT * FROM Products;
END getProducts;

Interface:

public interface ProductMapper
{
   @Select("call getProducts(#{rs,mode=OUT,jdbcType=CURSOR})")
   @Options(statementType = StatementType.CALLABLE)
   List<Product> getProducts();
}

DAO:

public class ProductDAO
{
   public List<Product> getProducts()
   {
       return mapper.getProducts(); // mapper is ProductMapper
   }
}

Error Message:
### Error querying database.  
Cause: org.apache.ibatis.reflection.ReflectionException: 
Could not set property 'rs' of 
'class org.apache.ibatis.reflection.MetaObject$NullObject' with value 
'oracle.jdbc.driver.OracleResultSetImpl@13f210f' 
Cause: org.apache.ibatis.reflection.ReflectionException: 
There is no setter for property named 'rs' in 'class java.lang.Class'


Thanks,
Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message