susongyan commented on issue #25838:
URL:
https://github.com/apache/shardingsphere/issues/25838#issuecomment-1557099930
code:
using jdbc to update json field 'alert_persons'
String sql = "UPDATE t_alert_rule SET alert_persons = ?, update_time =
CURRENT_TIMESTAMP WHERE id IN (?) RETURNING update_time";
try (Connection conn = dataSource.getConnection()) {
PreparedStatement preparedStatement = conn.prepareStatement(sql);
PGobject jsonObject = new PGobject();
jsonObject.setType("json");
jsonObject.setValue(JSON.toJSONString(Collections.singletonList("test)")));
preparedStatement.setObject(1, jsonObject);
preparedStatement.setLong(2, 130);
preparedStatement.execute();
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]