use of uk.gov.justice.services.jdbc.persistence.PreparedStatementWrapper in project microservice_framework by CJSCommonPlatform.
the class EventStreamJdbcRepository method insert.
public void insert(final UUID streamId, final boolean active) {
if (!isExistingStream(streamId)) {
try (final PreparedStatementWrapper ps = eventStreamJdbcRepositoryHelper.preparedStatementWrapperOf(dataSource, SQL_INSERT_EVENT_STREAM)) {
ps.setObject(1, streamId);
ps.setTimestamp(2, toSqlTimestamp(clock.now()));
ps.setBoolean(3, active);
ps.executeUpdate();
} catch (SQLException e) {
throw new JdbcRepositoryException(format("Exception while storing stream %s", streamId), e);
}
}
}
Aggregations