private void bindContainer(PreparedStatement statement, int accountId, Container container,
      StatementType statementType) throws SQLException {
    String containerInJson;
    try {
      containerInJson = objectMapper.writeValueAsString(container);
    } catch (IOException e) {
      throw new SQLException("Fail to serialize container: " + container.toString(), e);
    }
    switch (statementType) {
      case Insert:
        statement.setInt(1, accountId);
        statement.setString(2, containerInJson);
        statement.setInt(3, container.getSnapshotVersion());
        statement.setInt(4, container.getId());
        statement.setString(5, container.getName());
        statement.setString(6, container.getStatus().toString());
        break;
      case Update:
        statement.setString(1, containerInJson);
        statement.setInt(2, (container.getSnapshotVersion() + 1));
        statement.setString(3, container.getName());
        statement.setString(4, container.getStatus().toString());
        statement.setInt(5, accountId);
        statement.setInt(6, container.getId());
    }
  }
Binds parameters to prepare statements for {@link Container} inserts/updates
@param statement {@link PreparedStatement} for mysql queries
@param accountId Id of {@link Account} whose {@link Container} is being added to mysql
@param container {@link Container} being added to mysql
@param statementType {@link StatementType} of mysql query such as insert or update.
@throws SQLException
ambry-account/src/main/java/com/github/ambry/account/mysql/AccountDao.java