(Optional) Other components' version: spring-jdbc-5.2.6.RELEASE
Error logs
Steps to reproduce
Other descriptions
package com.github.housepower.jdbc;
public final class ClickHouseDatabaseMetadata implements SQLDatabaseMetadata {
@Override
public boolean supportsBatchUpdates() throws SQLException {
return false;
}
}
package org.springframework.jdbc.core;
public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
public int[] batchUpdate(String sql, final BatchPreparedStatementSetter pss) throws DataAccessException {
// ***
if (JdbcUtils.supportsBatchUpdates(ps.getConnection())) {
for (int i = 0; i < batchSize; i++) {
pss.setValues(ps, i);
if (ipss != null && ipss.isBatchExhausted(i)) {
break;
}
ps.addBatch();
}
return ps.executeBatch();
}
else {
List<Integer> rowsAffected = new ArrayList<>();
for (int i = 0; i < batchSize; i++) {
pss.setValues(ps, i);
if (ipss != null && ipss.isBatchExhausted(i)) {
break;
}
rowsAffected.add(ps.executeUpdate());
}
int[] rowsAffectedArray = new int[rowsAffected.size()];
for (int i = 0; i < rowsAffectedArray.length; i++) {
rowsAffectedArray[i] = rowsAffected.get(i);
}
return rowsAffectedArray;
}
}
//****
}
}
spring-jdbc judge that batch insertion is not supported according to method com.github.housepower.jdbc.ClickHouseDatabaseMetadata.supportsBatchUpdates return false。
I found that the method ru.yandex.clickhouse.ClickHouseDatabaseMetadata.supportsBatchUpdates return true in the official driver;
maybe it can return true to support batch insert?
Environment
Error logs
Steps to reproduce
Other descriptions
spring-jdbc judge that batch insertion is not supported according to method
com.github.housepower.jdbc.ClickHouseDatabaseMetadata.supportsBatchUpdates
return false。 I found that the methodru.yandex.clickhouse.ClickHouseDatabaseMetadata.supportsBatchUpdates
return true in the official driver; maybe it can return true to support batch insert?