function insertPersonData(fileName, tableName) {
  return getSampleData(fileName).then(
      function(data) {
        var resolver = new Resolver();
        var tx = db.transaction([tableName], 'readwrite');
        tx.oncomplete = function() {
          resolver.resolve();
        };
        tx.onerror = function(e) {
          resolver.reject();
        };

        var store = tx.objectStore(tableName);
        data.forEach(function(obj) {
          obj.dateOfBirth = convertDate(obj.dateOfBirth);
          obj.dateOfDeath = convertDate(obj.dateOfDeath);
          store.put(obj);
        });
        return resolver.promise;
      });
}
Inserts data in the database.
@param {string} fileName The name of the file holding JSON data.
@param {string} tableName The name of table.
@return {!IThenable}