public static void main(final String[] args) {

		try {
			// load mysql jdbc driver
			Class.forName("com.mysql.jdbc.Driver");

			// Setup the connection with the DB
			Importer.connect = DriverManager.getConnection("jdbc:mysql://localhost/" + props.getString(Importer.MOVIEDB_KEY) + "?user="
					+ props.getString(Importer.DBUSER_KEY) + "&password=" + props.getString(Importer.DBPASS_KEY));

		} catch (final ClassNotFoundException e) {
			LOG.info("mysql driver not found");
			e.printStackTrace();
		} catch (final SQLException e2) {
			LOG.info("Connection could not established.");
			e2.printStackTrace();
		}

		BufferedReader br = null;
		try {
			LOG.info(props.getString(Importer.EXPORT_FILE_KEY));
			final File file = new File(props.getString(Importer.EXPORT_FILE_KEY));
			br = new BufferedReader(new FileReader(file));

			// count for successful inserts
			int successCount = 0;
			int successCountWithWarnings = 0;
			int errorCount = 0;
			int alreadyInDBCount = 0;

			while (br.ready()) {

				// remove some characters and parentFolders
				String movieName = br.readLine();
				movieName = movieName.replace("./", "");
				movieName = movieName.substring(movieName.indexOf("/") + 1, movieName.length());

				LOG.info("Processing movie \"" + movieName + "\"...");

				// Remove unwanted space from moviename by trimming it and
				// replace whitespaces with "+"
				final String movieNameForURL = movieName.trim().replace(" ", "+");

				final Document doc = Importer.searchForMovies(movieNameForURL);
				final Map<String, String> resultMap = Importer.checkResultList(doc, movieName);
				resultMap.put(TITLE, movieName);

				if (!Importer.checkWhetherMovieIsAlreadyInDatabase(resultMap.get(TITLE))) {
					if (resultMap.containsKey(Importer.ERROR)) {
						errorCount++;
						Importer.LOG.info("ERROR: " + resultMap.get(Importer.ERROR));

					} else {
						// load movie details with given ID
						Importer.loadMovieDetails(resultMap);

						// save details in database
						Importer.saveDetailsInDatabase(resultMap);

						if (resultMap.containsKey(Importer.WARNING)) {
							successCountWithWarnings++;
							Importer.LOG.info("WARNING: " + resultMap.get(Importer.WARNING));
						}

						successCount++;
						Importer.LOG.info("... load data for \"" + movieName + "\" was successful");
					}
				} else {
					alreadyInDBCount++;
					LOG.info("... the movie is already in database, no need to import it.");
				}
			}

			LOG.info("-----------------------------------------------------------------------------------");
			LOG.info("|	Summary:");
			LOG.info("|     successful movie inserts:           " + successCount);
			LOG.info("|	    successful movie with warnings:     " + successCountWithWarnings);
			LOG.info("|	    error count:                        " + errorCount);
			LOG.info("|	    already in db:                      " + alreadyInDBCount);
			LOG.info("-----------------------------------------------------------------------------------");

		} catch (final IOException e) {
			e.printStackTrace();
		} finally {

			try {
				if (br != null) {
					br.close();
				}
			} catch (final IOException e) {
				e.printStackTrace();
			}
		}
	}