private String executeGetDatasetVersionRenameStatement(PreparedStatement statement, int accountId, int containerId,
      String datasetName, long sourceVersionValue) throws SQLException, AccountServiceException {
    ResultSet resultSet = null;
    try {
      statement.setInt(1, accountId);
      statement.setInt(2, containerId);
      statement.setString(3, datasetName);
      statement.setLong(4, sourceVersionValue);
      resultSet = statement.executeQuery();
      if (!resultSet.next()) {
        throw new AccountServiceException(
            "Version not found for account: " + accountId + " container: " + containerId + " dataset: " + datasetName
                + " version: " + sourceVersionValue, AccountServiceErrorCode.NotFound);
      }
      return resultSet.getString(RENAME_FROM);
    } finally {
      closeQuietly(resultSet);
    }
  }
Helper function to rename a dataset version from source version to target version.
@param accountId the id for the parent account.
@param containerId the id of the container.
@param datasetName the name of the dataset.
@param sourceVersion the source version to rename.
@param targetVersion the target version to rename.
@throws SQLException
@throws AccountServiceException
ambry-account/src/main/java/com/github/ambry/account/mysql/DatasetDao.java