You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @zhang18888888888, which version of ClickHouse server you're using? Before ClickHouse/ClickHouse#39866 can be fixed, you may use the workaround mentioned at #1023 for dealing with JSON.
i am using 22.10.1.1877.x86_64 version
using String type it works well, but i need json scene and my json data has deep nesting levels
issuse : batch insert data failed which contains json type
driver version:
com.clickhouse
clickhouse-jdbc
0.3.2-patch11
table schema :
test sql:
insert into test.zx1 (id, name, test) values (?, ?, ?)
code:
public void insert(String sql, JSONObject data) throws SQLException {
PreparedStatement preparedStatement = connection.prepareStatement(sql);
ClickHousePreparedStatement clickHousePreparedStatement = (ClickHousePreparedStatement) preparedStatement;
clickHousePreparedStatement.setInt(1, data.getInteger("id"));
clickHousePreparedStatement.setString(2, data.getJSONObject("name").toJSONString());
clickHousePreparedStatement.setInt(3, 4);
clickHousePreparedStatement.addBatch();
clickHousePreparedStatement.executeBatch();
}
exception:
The text was updated successfully, but these errors were encountered: