function insertData(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);
        for (var i = 0; i < data.length; ++i) {
          store.put(data[i]);
        }
        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 the table.
@return {!IThenable}