housepower / ClickHouse-Native-JDBC

ClickHouse Native Protocol JDBC implementation
https://housepower.github.io/ClickHouse-Native-JDBC/
Apache License 2.0
527 stars 145 forks source link

MyBatis Batch Insert Exception #416

Closed zyfbbd closed 1 year ago

zyfbbd commented 2 years ago

Environment

Error logs

Caused by: org.apache.ibatis.type.TypeException: Error setting non null for parameter #25 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Error at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:55) at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:87) ... 12 more Caused by: java.sql.SQLException: Error at com.alibaba.druid.pool.DruidDataSource.handleConnectionException(DruidDataSource.java:1811) at com.alibaba.druid.pool.DruidPooledConnection.handleException(DruidPooledConnection.java:137) at com.alibaba.druid.pool.DruidPooledStatement.checkException(DruidPooledStatement.java:93) at com.alibaba.druid.pool.DruidPooledPreparedStatement.setInt(DruidPooledPreparedStatement.java:316) at org.apache.ibatis.type.IntegerTypeHandler.setNonNullParameter(IntegerTypeHandler.java:31) at org.apache.ibatis.type.IntegerTypeHandler.setNonNullParameter(IntegerTypeHandler.java:26) at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:53) ... 13 more Caused by: java.lang.ArrayIndexOutOfBoundsException: 24 at com.github.housepower.jdbc.data.Block.setPlaceholderObject(Block.java:106) at com.github.housepower.jdbc.statement.ClickHousePreparedInsertStatement.setObject(ClickHousePreparedInsertStatement.java:70) at com.github.housepower.jdbc.statement.AbstractPreparedStatement.setInt(AbstractPreparedStatement.java:77) at com.alibaba.druid.pool.DruidPooledPreparedStatement.setInt(DruidPooledPreparedStatement.java:314) ... 16 more

Other descriptions

The third driver clickhouse-native-jdbc not support batch insert use mybatis ?

sundy-li commented 2 years ago

It did not support mybatis.

zyfbbd commented 2 years ago

It did not support mybatis.

Now I can select use mybatis and insert one row,but cann`t use foreach insert into table () values .

So how can I implement batch insert data to clickhouse?