You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by jimmymac <ja...@sungardps.com> on 2009/09/08 15:59:57 UTC

IBatis + Stored Procedures

I seem to be having an issue with mapping and stored procedures. I'm passing
in a value " O'Malley ". Shouldn't the use of  a prepared statement handle
the apostrophe? The API is returning a message of invalid character O' from
the DB2 database.

[code]
 <procedure id="SwipedCreditCard_insert"
parameterMap="SwipedCreditCard_procedureMap">
     {call ${sp.lib}.KLSCCAPI(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,  ?, ?, ?, ?, ?)}
   </procedure>
 [/code]
-- 
View this message in context: http://www.nabble.com/IBatis-%2B-Stored-Procedures-tp25346833p25346833.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: IBatis + Stored Procedures

Posted by jimmymac <ja...@sungardps.com>.
This is about all I can get from the logging.

Executing Statement: {call HTE60PGM.KLSCCAPI(?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}
{pstm-100016} Parameters: [HTE60PGM, HTE60QUA1, HT, , , , , , A, , 0, 0,
BNK, SWIP, 0, 0, 0000, , CR, njLxYNq6Ng3M/9TWAeIdaw==, 53, 53,
E10Jfq28CP9cGgipveWqyjNrENlxyyjNO16FBMPdpiY=, JOHN, O'MALLEY, , , , , , , ,
]
{pstm-100016} Types: [java.lang.String, java.lang.String, java.lang.String,
java.lang.String, java.lang.String, java.lang.String, java.lang.String,
java.lang.String, java.lang.String, java.lang.String, java.lang.Long,
java.lang.Long, java.lang.String, java.lang.String, java.lang.Long,
java.lang.Long, java.lang.String, java.lang.String, java.lang.String,
java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.String,
java.lang.String, java.lang.String, java.lang.String, java.lang.String,
java.lang.String, java.lang.String, java.lang.String, java.lang.String,
java.lang.String, java.lang.String]
[2009-09-03 13:20:28,502] [http-80-Processor25] [ERROR] -
[IBatisStoredProcDAO.insert] [failed to insert record for class
com.hteinc.op.services.types.SwipedCreditCard]



any chance you also have the logging output where the sql generated by
ibatis?


-- 
View this message in context: http://www.nabble.com/IBatis-%2B-Stored-Procedures-tp25346833p25352028.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: IBatis + Stored Procedures

Posted by Nathan Maves <na...@gmail.com>.
any chance you also have the logging output where the sql generated by
ibatis?

On Tue, Sep 8, 2009 at 8:36 AM, jimmymac <ja...@sungardps.com>wrote:

>
> It's choking on the lastname value being read off a magnetic strip. Here is
> the relevant portion of the map
> Here is the parameter map:
>  <parameterMap class="com.sps.dao.ibatis.DataWrapper"
> id="SwipedCreditCard_procedureMap">
> ......
>      <parameter property="data.name.firstName" mode="IN"
> javaType="java.lang.String" jdbcType="VARCHAR"/>
>      <parameter property="data.name.lastName" mode="IN"
> javaType="java.lang.String" jdbcType="VARCHAR"/>
>      <parameter property="data.name.middleInitial" mode="IN"
> javaType="java.lang.String" jdbcType="VARCHAR"/>
> .......
> </parameterMap>
>
>
>
>
> And the exception:
>
> [2009-09-03 13:20:28,502] [http-80-Processor25] [ERROR] -
> [IBatisStoredProcDAO.insert] [failed to insert record for class
> com.hteinc.op.services.types.SwipedCreditCard]
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in com/op/services/types/SwipedCreditCard.xml.
> --- The error occurred while applying a parameter map.
> --- Check the SwipedCreditCard.SwipedCreditCard_procedureMap.
> --- Check the statement (update procedure failed).
> --- Cause: java.sql.SQLException: [SQL0104] Token 'O' was not valid. Valid
> tokens: (.
>        at
>
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:91)
>        at
>
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:447)
>        at
>
> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
>        at
>
> com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:59)
>
> Thanks for looking.
>
>
>
> nmaves wrote:
> >
> > Post your parameter map and the actual exception you are getting.
> >
> > On Tue, Sep 8, 2009 at 7:59 AM, jimmymac
> > <ja...@sungardps.com>wrote:
> >
> >>
> >> I seem to be having an issue with mapping and stored procedures. I'm
> >> passing
> >> in a value " O'Malley ". Shouldn't the use of  a prepared statement
> >> handle
> >> the apostrophe? The API is returning a message of invalid character O'
> >> from
> >> the DB2 database.
> >>
> >> [code]
> >>  <procedure id="SwipedCreditCard_insert"
> >> parameterMap="SwipedCreditCard_procedureMap">
> >>     {call ${sp.lib}.KLSCCAPI(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?,
> >> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,  ?, ?, ?, ?, ?)}
> >>   </procedure>
> >>  [/code]
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/IBatis-%2B-Stored-Procedures-tp25346833p25346833.html
> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> >> For additional commands, e-mail: user-java-help@ibatis.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/IBatis-%2B-Stored-Procedures-tp25346833p25347487.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>

Re: IBatis + Stored Procedures

Posted by jimmymac <ja...@sungardps.com>.
It's choking on the lastname value being read off a magnetic strip. Here is
the relevant portion of the map
Here is the parameter map:
  <parameterMap class="com.sps.dao.ibatis.DataWrapper"
id="SwipedCreditCard_procedureMap">
......
      <parameter property="data.name.firstName" mode="IN"
javaType="java.lang.String" jdbcType="VARCHAR"/>
      <parameter property="data.name.lastName" mode="IN"
javaType="java.lang.String" jdbcType="VARCHAR"/>
      <parameter property="data.name.middleInitial" mode="IN"
javaType="java.lang.String" jdbcType="VARCHAR"/>
.......
</parameterMap>

     


And the exception:

[2009-09-03 13:20:28,502] [http-80-Processor25] [ERROR] -
[IBatisStoredProcDAO.insert] [failed to insert record for class
com.hteinc.op.services.types.SwipedCreditCard]
com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/op/services/types/SwipedCreditCard.xml.  
--- The error occurred while applying a parameter map.  
--- Check the SwipedCreditCard.SwipedCreditCard_procedureMap.  
--- Check the statement (update procedure failed).  
--- Cause: java.sql.SQLException: [SQL0104] Token 'O' was not valid. Valid
tokens: (.
	at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:91)
	at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:447)
	at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
	at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:59)

Thanks for looking.



nmaves wrote:
> 
> Post your parameter map and the actual exception you are getting.
> 
> On Tue, Sep 8, 2009 at 7:59 AM, jimmymac
> <ja...@sungardps.com>wrote:
> 
>>
>> I seem to be having an issue with mapping and stored procedures. I'm
>> passing
>> in a value " O'Malley ". Shouldn't the use of  a prepared statement
>> handle
>> the apostrophe? The API is returning a message of invalid character O'
>> from
>> the DB2 database.
>>
>> [code]
>>  <procedure id="SwipedCreditCard_insert"
>> parameterMap="SwipedCreditCard_procedureMap">
>>     {call ${sp.lib}.KLSCCAPI(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,  ?, ?, ?, ?, ?)}
>>   </procedure>
>>  [/code]
>> --
>> View this message in context:
>> http://www.nabble.com/IBatis-%2B-Stored-Procedures-tp25346833p25346833.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/IBatis-%2B-Stored-Procedures-tp25346833p25347487.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: IBatis + Stored Procedures

Posted by Nathan Maves <na...@gmail.com>.
Post your parameter map and the actual exception you are getting.

On Tue, Sep 8, 2009 at 7:59 AM, jimmymac <ja...@sungardps.com>wrote:

>
> I seem to be having an issue with mapping and stored procedures. I'm
> passing
> in a value " O'Malley ". Shouldn't the use of  a prepared statement handle
> the apostrophe? The API is returning a message of invalid character O' from
> the DB2 database.
>
> [code]
>  <procedure id="SwipedCreditCard_insert"
> parameterMap="SwipedCreditCard_procedureMap">
>     {call ${sp.lib}.KLSCCAPI(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,  ?, ?, ?, ?, ?)}
>   </procedure>
>  [/code]
> --
> View this message in context:
> http://www.nabble.com/IBatis-%2B-Stored-Procedures-tp25346833p25346833.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>