ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Deshpande, Bhushan M \(IT\)" <Bhushan.Deshpa...@morganstanley.com>
Subject stored proc doesn't return output parameter
Date Wed, 31 Aug 2005 12:26:34 GMT
Hi All ,
   I am using Ibatis 2.1.5 to execute a stored proc on sybase databse
which retuns a string result .
Entries in contiguration xml file is 
<parameterMap id="getContactParameters" class="map" >

<parameter property="contactId" jdbcType="INTEGER"
javaType="java.lang.Integer" mode="IN"/>

<parameter property="firstName" jdbcType="VARCHAR"
javaType="java.lang.String" mode="OUT"/>


<procedure id="spGetContacts" parameterMap="getContactParameters" >

{? sp_sample_get_contact (?)} 



also tried 

{? = call sp_sample_get_contact (?)}  but of no avail ;(


Code in the servlet  for excution 

Reader configReader = Resources.getResourceAsReader("SqlMapConfig.xml");

SqlMapClient sqlMap =


HashMap paramMap = new HashMap();


paramMap.put("contactId", new Integer(1));

sqlMap.queryForObject("spGetContacts", paramMap);

String firstName = (String) paramMap.get("firstName");



Variable FirstName returns "0" instead of expected result .

However if the same operation is tried with simple query way it works
fine .

<select id="getContact" parameterClass="int"
resultClass="contact">select FIRSTNAME as firstName,LASTNAME as
lastName, CONTACTID as contactId from CONTACT where CONTACTID =

Thanks for your all help in advance .

NOTICE: If received in error, please destroy and notify sender.  Sender does not waive confidentiality
or privilege, and use is prohibited.

View raw message