ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snehalkgandhi <snehal.k.gan...@jpmchase.com>
Subject Error Calling SP on SQL Server
Date Mon, 04 Feb 2008 17:03:38 GMT

  I'm trying to call an Stored Procedure(SP) in SQL Server 2000. The SP
takes in 2 parameters and returns a resultset. I tried the searching for the
jdbcType="??" for the SQL Server DB. For Oracle we have ORACLECURSOR and I
don't know what is it for SQL Server.

I'm getting 2 errors.. 
    1st Error : Error Message when I try to build the project.
Err. Msg : Caused by: com.ibatis.common.exception.NestedRuntimeException:
Error occurred.  Cause: com.ibatis.common.xml.NodeletException: Error
parsing XML.  Cause: com.ibatis.common.exception.NestedRuntimeException:
Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause:
org.xml.sax.SAXParseException: Attribute "resultMap" must be declared for
element type "parameter".

    2nd Error : If I remove the resultMap="loginresult" from the OUT
Parameter of parameterMapid="rrParameters", then the project build fine but
throws an Exception at runtime saying the SQL Type is not supported by the

Can someone please help me on this and being stuck out here for the last 8

Code :
	<resultMap id="loginresult" class="com.rr.beans.RRBean">
		<result property="userId" column="userid" />
		<result property="firstName" column="firstname" />
		<result property="lastName" column="lastname" />

	<parameterMap id="rrParameters" class="Map">
		<parameter property="userId" jdbcType="VARCHAR" mode="IN" />
		<parameter property="password" jdbcType="VARCHAR" mode="IN" />
		<parameter property="rrLogBean" jdbcType="refcursor"
			javaType="java.sql.ResultSet" mode="OUT" resultMap="loginresult" />

	<procedure id="rrlogin" parameterMap="rrParameters"
		{call i031846.rr_login(?, ?, ?)}

Java Code :
    	Map parameters = new HashMap();
    	logInfo("IN DAO - rrLoginBean.getUserId() : " +
    	logInfo("IN DAO - rrLoginBean.getPassword() : " +
    	parameters.put("userId", rrLoginBean.getUserId());
    	parameters.put("password", rrLoginBean.getPassword());
             getSqlMapClientTemplate().update(keyValue, obj);
             rrLogin = (RRLoginBean)parameters.get("rrLoginBean");

Thanks in Advance
Snehal Gandhi
View this message in context: http://www.nabble.com/Error-Calling-SP-on-SQL-Server-tp15269015p15269015.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

View raw message