private void bindAccount(PreparedStatement statement, Account account, StatementType statementType)
      throws SQLException {
    String accountInJson;
    try {
      accountInJson = new String(AccountCollectionSerde.serializeAccountsInJsonNoContainers(account));
    } catch (IOException e) {
      throw new SQLException("Fail to serialize account: " + account.toString(), e);
    }
    switch (statementType) {
      case Insert:
        statement.setString(1, accountInJson);
        statement.setInt(2, account.getSnapshotVersion());
        statement.setInt(3, account.getId());
        statement.setString(4, account.getName());
        statement.setString(5, account.getStatus().toString());
        break;
      case Update:
        statement.setString(1, accountInJson);
        statement.setInt(2, (account.getSnapshotVersion() + 1));
        statement.setString(3, account.getName());
        statement.setString(4, account.getStatus().toString());
        statement.setInt(5, account.getId());
        break;
    }
  }
Binds parameters to prepare statements for {@link Account} inserts/updates
@param statement {@link PreparedStatement} for mysql queries
@param account {@link Account} 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