public void addDataset(int accountId, int containerId, Dataset dataset)
      throws SQLException, AccountServiceException {
    long startTimeMs = System.currentTimeMillis();
    try {
      dataAccessor.getDatabaseConnection(true);
      PreparedStatement insertDatasetStatement = dataAccessor.getPreparedStatement(insertDatasetSql, true);
      executeAddDatasetStatement(insertDatasetStatement, accountId, containerId, dataset);
      dataAccessor.onSuccess(Write, System.currentTimeMillis() - startTimeMs);
    } catch (SQLException | AccountServiceException e) {
      if (e instanceof SQLIntegrityConstraintViolationException) {
        PreparedStatement updateDatasetSqlIfExpiredStatement =
            dataAccessor.getPreparedStatement(updateDatasetIfExpiredSql, true);
        if (executeUpdateDatasetSqlIfExpiredStatement(updateDatasetSqlIfExpiredStatement, accountId, containerId,
            dataset) <= 0) {
          throw new AccountServiceException("The dataset already exist", AccountServiceErrorCode.ResourceConflict);
        } else {
          dataAccessor.onSuccess(Write, System.currentTimeMillis() - startTimeMs);
          return;
        }
      }
      dataAccessor.onException(e, Write);
      throw e;
    }
  }
Add {@link Dataset} based on the supplied properties.
@param accountId the id for the parent account.
@param containerId the id of the container.
@param dataset the {@link Dataset}
@throws SQLException
ambry-account/src/main/java/com/github/ambry/account/mysql/DatasetDao.java