Looks like your update is trying to stuff a string value into an integer column.

The tutorial update statement is:

update person set first_name = ?, last_name = ? where id = ?

Which uses the  parameterMap:

   <parameterMap id="updateParam" class="person">
       <parameter property="id" jdbcType="INTEGER" javaType="java.lang.Long"/>
       <parameter property="firstName" jdbcType="VARCHAR" 
javaType="java.lang.String"/>
       <parameter property="lastName" jdbcType="VARCHAR" 
javaType="java.lang.String"/>
   </parameterMap>

Move the property="id" line down under the property="lastName" line, and that 
should fix the error.


[EMAIL PROTECTED] wrote:
hi everyone
i found an error about ibatis test.who can tell me the reason?
thanks
-------------------------------------------------------------------------------
Test set: org.appfuse.tutorial.webapp.controller.PersonFormControllerTest
-------------------------------------------------------------------------------
Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.141 sec <<< FAILURE! testSave(org.appfuse.tutorial.webapp.controller.PersonFormControllerTest) Time elapsed: 0.109 sec <<< ERROR! org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [01004]; error code [0];
--- The error occurred in sqlmaps/PersonSQL.xml.
--- The error occurred while applying a parameter map.
--- Check the PersonSQL.updateParam.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'Raible,Updated Last Name1'; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in sqlmaps/PersonSQL.xml.
--- The error occurred while applying a parameter map.
--- Check the PersonSQL.updateParam.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'Raible,Updated Last Name1' at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:121) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to