public static void main(String[] args) {
		if (args.length < 3) {
			System.out.println("Usage: java -jar test.jar HOSTNAME DATABASE USERNAME [PASSWORD]");
			System.exit(1);
		}
		String password = (args.length >= 4) ? args[3] : "";

		// Initializes the EntityManager
		SingletonEntityManager.setup(args[0], args[1], args[2], password);
		// Creates the global BufferedReader with System.in as input stream
		inputReader = new BufferedReader(new InputStreamReader(System.in));

		// Menu loop, loops until a valid value have been entered
		int choice = -1;
		try {
			while (true) {
				choice = printMenuAndGetResult();
				switch (choice) {
				case 1:
					getAllCoursesForAStudent();
					System.exit(0);
				case 2:
					printResultListForCourse();
					System.exit(0);
				case 3:
					printExamQuestionsResult();
					System.exit(0);
				case 0:
					System.exit(0);
				default:
					System.out.println("Invalid choice.");
					break;
				}
			}
		} catch (IOException e) {
			System.err.println("An IO-error have occured, exiting");
			System.exit(1);
		}
	}