ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gita A L <gitag...@gmail.com>
Subject Issue in executing callable and prepared statements together
Date Thu, 09 Oct 2008 02:06:57 GMT

Hi,

I am trying to call a stored procedure (Callable Statement) and then execute
a prepared statement using ibatis, both of them work correctly when they are
executed separately but when they are executed one after another the
execution of the callable statement works fine but it fails while executing
the prepared statement.

// Callable Statement
 List patientList    =
getSqlMapClientTemplate().queryForList("patients.getClientPatients", map);
// Prepared Statement
 List orderUnitList  =
getSqlMapClientTemplate().queryForList("account.getOrderUnitList", params);    

Below is the error log 

org.springframework.dao.DataAccessResourceFailureException: SqlMapClient
operation; SQL [];   
--- The error occurred in ibatis/account.xml.  
--- The error occurred while executing query.  
--- Check the          select  ISNULL(trim(BOTH '' from sto.SOU_Name),
ou.OU_Name)  as name,                 sto.SOU_OrdUnitDR   as code        
from    ST_SOrdUnit sto,                  MT_OrdUnit  ou         where  
ST_Study            = ?          and     sto.SOU_OrdUnitDR   = ou.MT_OrdUnit    
.  
--- Check the SQL Statement (preparation failed).  
--- Cause: java.sql.SQLException: Invalid Message Count (452); expected: 7
got: 6. Connection closed; nested exception is
com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in ibatis/account.xml.  
--- The error occurred while executing query.  
--- Check the          select  ISNULL(trim(BOTH '' from sto.SOU_Name),
ou.OU_Name)  as name,                 sto.SOU_OrdUnitDR   as code        
from    ST_SOrdUnit sto,                  MT_OrdUnit  ou         where  
ST_Study            = ?          and     sto.SOU_OrdUnitDR   = ou.MT_OrdUnit    
.  
--- Check the SQL Statement (preparation failed).  
--- Cause: java.sql.SQLException: Invalid Message Count (452); expected: 7
got: 6. Connection closed


If anyone has any clues about this, please let me know.

Thanks,
Gita
-- 
View this message in context: http://www.nabble.com/Issue-in-executing-callable-and-prepared-statements-together-tp19891000p19891000.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Mime
View raw message