java - mybatis type conversion error -


there problem can not configure out , have pojo ,

private string userid; private string username; private string password; private string contacttel; private string email; 

the getter , setter no problem,and type in database varchar2 , database use oracle 11g,when update record ,there comes error,here stack,some can me ,

debug [http-8080-1] - closing non transactional sqlsession [org.apache.ibatis.session.defaults.defaultsqlsession@18b198d1] org.mybatis.spring.mybatissystemexception: nested exception org.apache.ibatis.exceptions.persistenceexception:

error updating database. cause: java.lang.numberformatexception: input string: "abcd"

cause: java.lang.numberformatexception: input string: "abcd"

at org.mybatis.spring.mybatisexceptiontranslator.translateexceptionifpossible(mybatisexceptiontranslator.java:73) @ org.mybatis.spring.sqlsessiontemplate$sqlsessioninterceptor.invoke(sqlsessiontemplate.java:364) 

check test condition clause , make sure not comparing string number

eg if test="userid!= null , userid != '' , userid != -1 "

if case,put quotes around -1 make string


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -