java - Sql binding in Spring throws org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException -
im making spring mvc web application. database access i'm using sql binding. running yesterday encountered unabletoexecutestatementexception
when tried edit user data web app.
this code i've errors per stacktrace.
public string edituser (userdto objuserdto) { handle objhandle = objbaseservice.gethandle(); objhandle.createstatement("update user set email = :email," + "usertypeid = :usertypeid," + "username = :username," + "trackinginterval = :trackinginterval," + "enablewebcam = :enablewebcam," + "showcaptureinfo = :showcaptureinfo," + "showseverinfo = :showserverinfo," + "autologin = :autologin," + "remarks = :remarks userid = :userid") .bind("email", objuserdto.getemail()) .bind("usertypeid", objuserdto.getusertypeid()) .bind("username", objuserdto.getusername()) .bind("trackinginterval", objuserdto.gettrackinginterval()) .bind("enablewebcam", objuserdto.getenablewebcam()) .bind("showcaptureinfo", objuserdto.getshowcaptureinfo()) .bind("showserverinfo", objuserdto.getshowserverinfo()) .bind("autologin", objuserdto.getautologin()) .bind("remarks", objuserdto.getremarks()) .bind("userid", objuserdto.getuserid()) .execute(); //userservice.java:106 return "success"; }
and usercontroller edit function calling userservice.
public userservice objuserservice; string userresult = objuserservice.edituser(objuserdto);//(usercontroller.java:111)
and stacktrace is:
org.skife.jdbi.v2.exceptions.unabletoexecutestatementexception: com.mysql.jdbc.exceptions.mysqlsyntaxerrorexception: unknown column 'showseverinfo' in 'field list' @ org.skife.jdbi.v2.sqlstatement.internalexecute(sqlstatement.java:873) @ org.skife.jdbi.v2.update.execute(update.java:51) @ com.isa.tt.service.userservice.edituser(userservice.java:106) @ com.isa.tt.controller.usercontroller.updateuser(usercontroller.java:111) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.springframework.web.bind.annotation.support.handlermethodinvoker.invokehandlermethod(handlermethodinvoker.java:175) @ org.springframework.web.servlet.mvc.annotation.annotationmethodhandleradapter.invokehandlermethod(annotationmethodhandleradapter.java:421) @ org.springframework.web.servlet.mvc.annotation.annotationmethodhandleradapter.handle(annotationmethodhandleradapter.java:409) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:774) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:719)
its confusing cause have shpwserverinfo column in database.
any appreciated.
exception says it, mysqlsyntaxerrorexception: unknown column showseverinfo
in field list. please make sure field showseverinfo
exists in table user
Comments
Post a Comment