ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Broderick, Kevin" <kevin.broder...@iona.com>
Subject returning value from stored procedure
Date Wed, 16 Nov 2005 15:15:39 GMT
 

Hi,

I'm trying to get the return values from a stored procedure. Working
from the standard example below, 

Would I be calling the procedure like this:

 

try

{

               map.put("email1", "john.smith@gmail.com");

               map.put("email1", "john.smith@gmail.com");

 

sqlMapClient.queryForObject("saveTouch", map);             

 

log.info("email1: " + (String)map.get("email1"));

log.info("email2: " + (String)map.get("email2"));

 

} catch (Exception e) {

e.printStackTrace();

}

 

 

<parameterMap id="emailParameters" class="java.util.HashMap" >

<parameter property="id"       jdbcType="NUMBER"
javaType="java.lang.Integer" mode="INOUT"/>

<parameter property="email"  jdbcType="VARCHAR"
javaType="java.lang.String"  mode="IN"/>

</parameterMap>

 

<procedure id="saveEmailAddresses" parameterMap="emailParameters" >

{call save_email_address (?, ?)}

</procedure>

 

Currently returning this error:

--- The error occurred in SqlMapEMDB.xml.  

--- The error occurred while applying a parameter map.  

--- Check the touchParameters.  

--- Check the output parameters (retrieval of output parameters failed).


--- Cause: java.lang.NullPointerException

Caused by: java.lang.NullPointerException

15:04:47,765 ERROR [STDERR]    at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery
WithCallback(GeneralStatement.java:184)

15:04:47,765 ERROR [STDERR]    at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery
ForObject(GeneralStatement.java:100)

 

Is there any reassignment necessary from the queryForObject method???

I'm using SQL Server and the id parameter in the stored procedure is set
to INOUT.

 

Thanks,

Kevin

 


Mime
View raw message