ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashok Madhavan" <ashok.madha...@gmail.com>
Subject Re: Substitution Error on Insert?
Date Tue, 22 Jan 2008 16:10:13 GMT
shouldnt you be using something like this :

<update id="updateContractStatus" parameterMap="update">

   update digicon.contract set contractStatusCode = #
contractStatusCode:INTEGER# where contractId = #contractId#

</update>
regards
ashok

On Jan 22, 2008 3:45 PM, Krenek, Robert <Robert.Krenek@emc.com> wrote:

>  Hi All,
>
>
>
> I'm running into an issue that I cannot resolve.  If you can provide any
> assistance, your help would be much appreciated.
>
>
>
> The environment consists of Ibatis, along with Apache and Tomcat on Linux
> connecting to a DB2 database on an as400.
>
>
>
> Insert statements that once worked, are suddenly failing with the
> following error:
>
>
>
> java.sql.SQLException: The number of parameter values set or registered does not match
the number of parameters.
>
>         com.ibm.as400.access.JDError.throwSQLException(JDError.java:360)
>
>         com.ibm.as400.access.AS400JDBCPreparedStatement.commonExecuteBefore(AS400JDBCPreparedStatement.java:464)
>
>         com.ibm.as400.access.AS400JDBCStatement.commonExecute(AS400JDBCStatement.java:631)
>
>         com.ibm.as400.access.AS400JDBCPreparedStatement.execute(AS400JDBCPreparedStatement.java:726)
>
>         com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:81)
>
>         com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteUpdate(GeneralStatement.java:200)
>
>         com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:78)
>
>         com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update(SqlMapExecutorDelegate.java:505)
>
>         com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.update(SqlMapSessionImpl.java:90)
>
>         com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.update(SqlMapClientImpl.java:67)
>
>         net.diginc.digicon.dao.HomeOfficeAdminDAO.updateContractStatus(HomeOfficeAdminDAO.java:172)
>
>         net.diginc.digicon.services.HomeOfficeAdminService.abandonContract(HomeOfficeAdminService.java:359)
>
>         org.apache.jsp.ProcessAbandonContract_jsp._jspService(ProcessAbandonContract_jsp.java:65)
>
>         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
>
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
>
>         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
>
>         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
>
>
>
> Here is the DAO insert code:
>
>
>
> *public* *void* updateContractStatus( String contractId, ContractStatus
> contractStatus ) *throws* Exception
>
>       {
>
>             SqlMapClient sqlMap = FdlicSqlConfiguration.*getSqlMapInstance
> *();
>
>             HashMap<String,Object> parameters = *new* HashMap<String,
> Object>();
>
>             parameters.put("contractStatusCode", contractStatus.getCode()
> );
>
>             parameters.put("contractId", contractId );
>
>             sqlMap.update("updateContractStatus", parameters );
>
>       }
>
>
>
>
>
> Here is the map from the sqlmap:
>
>
>
> <parameterMap id="update" class="java.util.Map">
>
>    <parameter property="contractStatusCode"  jdbcType="INTEGER"/>
>
>    <parameter property="contractId"  jdbcType="VARCHAR"/>
>
> </parameterMap>
>
>
>
> <update id="updateContractStatus" parameterMap="update">
>
>    update digicon.contract set contractStatusCode = ? where contractId = ?
>
> </update>
>
>
>
>
>
> It appears to me as though the "?" are not being substituted. Any thoughts
> would be greatly appreciated.
>
>
>
> Best Regards,
>
> Robert Krenek
>
>
>
>
>
>
>
>
>

Mime
View raw message