Org.apache.ibatis.type.type Exception Error Setting Null Parameter
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss error setting null for parameter #1 with jdbctype other the workings and policies of this site About Us Learn more
Error Setting Null For Parameter With Jdbctype Other
about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack mybatis jdbctypefornull Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping
Jdbctype For Null Configuration Property
each other. Join them; it only takes a minute: Sign up Mybatis-Error setting null parameter up vote 5 down vote favorite 1 I used mybatis-spring-1.0.3-SNAPSHOT mybatis-3.0.6 spring3.0.6.I tried to delete record from a table like this:
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and
Try Setting A Different Jdbctype For This Parameter Or A Different Configuration Property
policies of this site About Us Learn more about Stack Overflow the company
Mybatis Check List Size
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users invalid column type: 1111 Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a http://stackoverflow.com/questions/8455552/mybatis-error-setting-null-parameter minute: Sign up In MyBatis, is there any solution for not adding jdbcType when setting null parameters? up vote 0 down vote favorite I'm using mybatis-3.2.8.jar and JDK 1.6.0_45. The source table is called emp: > EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO SHORTCUT > > 7499 ALLEN SALESMAN 7698 1981/02/20 00:00:00 1600 300 30 null and the SQL is http://stackoverflow.com/questions/30568376/in-mybatis-is-there-any-solution-for-not-adding-jdbctype-when-setting-null-para this: insert into emp (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO, SHORTCUT) values (#{EMPNO},#{ENAME},#{JOB},#{MGR},#{HIREDATE},#{SAL},#{COMM},#{DEPTNO},#{SHORTCUT}); I'm using this SQL row by row. Select 1 row then insert, again and again. Or think the table just has 1 row. Then I'm facing this error: org.apache.ibatis.exceptions.PersistenceException: #### Error updating database. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #7 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=insert into TB_ODS_EMP2(EMPNO,ENAME,JOB,MGR;BEGIN-OF-STATEMENT;
OTHER 2 posts / 0 new Log in https://forums.activiti.org/content/error-setting-null-parameter-1-jdbctype-other or register to post comments Last post Tue, 05/19/2015 - 15:19 #1 gi00vani_kun Offline Last seen: 1 year 4 months ago Joined: 02/27/2015 - http://mybatis-user.963551.n3.nabble.com/Invalid-column-type-1111-td1717787.html 13:50 Posts: 9 Error setting null for parameter #1 with JdbcType OTHER I'm trying to create a new task on an complete event error setting Java Code below : ProcessEngine processEngine = ProcessEngines .getDefaultProcessEngine(); TaskService taskService = processEngine.getTaskService(); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss"); Task task = taskService.newTask(); task.setDescription("description 12131"); task.setName("taskname 2121"); task.setPriority(50); task.setAssignee("dataexpert2"); task.setOwner("dataexpert2"); Date dueDate; try { dueDate = sdf.parse("01/05/2015 04:05:06"); task.setDueDate(dueDate); } catch (ParseException e1) { // error setting null TODO Auto-generated catch block e1.printStackTrace(); } taskService.saveTask(task); Error resulted : Caused by: org.activiti.engine.ActivitiException: Exception while invoking TaskListener: ### Error querying database. Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Invalid column type: 1111 ### The error may exist in org/activiti/db/mapping/entity/HistoricTaskInstance.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: select * from ACT_HI_TASKINST where ID_ = ? ### Cause: org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Invalid column type: 1111 at org.activiti.engine.impl.bpmn.helper.ClassDelegate.notify(ClassDelegate.java:109) at org.activiti.engine.impl.delegate.TaskListenerInvocation.invoke(TaskListenerInvocation.java:34) at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37) at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25) at org.activiti.engine.impl.persistence.entity.TaskEntity.fireEvent(TaskEntity.java:723) ... 61 more Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.iba
Inappropriate ♦ ♦ Invalid column type: 1111 When I am doing in the insert into the table, I am getting the following error. I am running it as stand alone application using spring and MyBatis. Can anyone tell me how to print sql in the console (eclipse) and how to find which column it is complaining for invalid type. There are around 50 columns and it is hard to find out without proper error message. Thanks in advance Caused by: org.apache.ibatis.type.TypeException: Error setting null parameter. Most JDBC drivers require that the JdbcType must be specified for all nullable parameters. Cause: java.sql.SQLException: Invalid column type: 1111 at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java: 17) at org.apache.ibatis.executor.parameter.DefaultParameterHandler.setParameters(DefaultParameterHandler.java: 73) at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java: 61) at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java: 43) at org.apache.ibatis.executor.ReuseExecutor.prepareStatement(ReuseExecutor.java: 62) at org.apache.ibatis.executor.ReuseExecutor.doUpdate(ReuseExecutor.java: 31) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java: 73) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java: 102) Larry Meadors Reply | Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Re: Invalid column type: 1111 One of the values you are inserting is null, and you didn't tell mybatis the jdbc type, so it uses the default jdbc type which is Types.UNKNOWN (1111). The reason you don't get the column name that is causing the issue is that the driver doesn't tell us - it's not a mybatis thing, it's just how the driver works. Sucks, but true. I'd look at the data you're inserting to see which fields are null - it's one of them. Change your mapped statement to provide jdbc types for them, and you should be good to go. Larry On Sat, Oct 16, 2010 at 10:00 PM, MSana <[hidden email]> wrote: > When I am doing in the insert into the table, I am getting the > following error. I am running it as stand alone application using > spring and MyBatis. Can anyone tell me how to print sql in the console > (eclipse) and how to find which column it is complaining for invalid > type. There are around 50 columns and it is hard to find out without > proper error message. > > Thanks in advance > > Caused by: org.apache.ibatis.type.TypeException: Error setting null > parameter. Most JDBC driver