private void loadConfiguration() {
        Boolean checkConfigurationFile = true;
        Boolean checkUpdateNecessarity = true;
        
        while (checkConfigurationFile) {
            //Check for configuration file
            if (this.pMain.getProgram().getConfiguration().ConfigurationFileExists()) {
                //Configuration file exists.
                //Load configuration.
                if (this.pMain.getProgram().getConfiguration().loadDatabaseSettings()) {
                    //Configuration file loaded.
                    //Check database.
                    while (checkUpdateNecessarity) {
                        //Check if database is accessible.
                        if (this.pMain.getProgram().DatabaseAccessible()) {
                            //Database is accessible.
                            //Check if database update necessary.
                            if (this.pMain.updateNecessary()) {
                                //Update necessary.
                                //Run update.
                                openWindowUpdate();
                            }
                            //Database check done.
                            checkConfigurationFile = false;
                            checkUpdateNecessarity = false;
                        } else {
                            //Database is not accessible.
                            Object[] databaseNotAccessibleDialogOptions = {"View Configuration", "No", "Yes"};
                            int databaseNotAccessibleDialogResponse = JOptionPane.showOptionDialog(this, "The database is not accessible. Retry?", "Database not accessible", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, databaseNotAccessibleDialogOptions, databaseNotAccessibleDialogOptions[2]);
                            if (databaseNotAccessibleDialogResponse == 2) {
                                //Retry check.
                            } else if (databaseNotAccessibleDialogResponse == 0) {
                                //Configure configuration file.
                                openWindowConfiguration();
                            } else {
                                //Database check abborted.
                                System.exit(0);
                            }
                        }
                    }
                } else {
                    //Configuration file not loaded.
                    //Check configuration settings.
                    openWindowConfiguration();
                }
            } else {
                //Configuration file does not exist.
                //Create configuration file.
                openWindowConfiguration();
            }
        }
    }