/** * Utility method for retrieving the login credentials for a database connection. * * @param taskConfig Contains all information required to instantiate and configure the task. * @return The value of the argument. */ protected DatabasePreferences getDatabasePreferences(TaskConfiguration taskConfig) { DatabasePreferences preferences; // Create a new preferences object with default values. preferences = new DatabasePreferences(DatabaseConstants.TASK_DEFAULT_VALIDATE_SCHEMA_VERSION, DatabaseConstants.TASK_ALLOW_INCORRECT_SCHEMA_VERSION); // Update the preferences with any explicit arguments provided on the // command line. preferences.setValidateSchemaVersion(getBooleanArgument(taskConfig, DatabaseConstants.TASK_ARG_VALIDATE_SCHEMA_VERSION, preferences.getValidateSchemaVersion())); preferences .setAllowIncorrectSchemaVersion(getBooleanArgument(taskConfig, DatabaseConstants.TASK_ARG_ALLOW_INCORRECT_SCHEMA_VERSION, preferences .getAllowIncorrectSchemaVersion())); return preferences; } }
/** * Utility method for retrieving the login credentials for a database connection. * * @param taskConfig Contains all information required to instantiate and configure the task. * @return The value of the argument. */ protected DatabasePreferences getDatabasePreferences(TaskConfiguration taskConfig) { DatabasePreferences preferences; // Create a new preferences object with default values. preferences = new DatabasePreferences(DatabaseConstants.TASK_DEFAULT_VALIDATE_SCHEMA_VERSION, DatabaseConstants.TASK_ALLOW_INCORRECT_SCHEMA_VERSION); // Update the preferences with any explicit arguments provided on the // command line. preferences.setValidateSchemaVersion(getBooleanArgument(taskConfig, DatabaseConstants.TASK_ARG_VALIDATE_SCHEMA_VERSION, preferences.getValidateSchemaVersion())); preferences .setAllowIncorrectSchemaVersion(getBooleanArgument(taskConfig, DatabaseConstants.TASK_ARG_ALLOW_INCORRECT_SCHEMA_VERSION, preferences .getAllowIncorrectSchemaVersion())); return preferences; } }
loginCredentials.setPassword(getStringArgument(taskConfig, DatabaseConstants.TASK_ARG_PASSWORD, loginCredentials.getPassword())); loginCredentials.setForceUtf8(getBooleanArgument(taskConfig, DatabaseConstants.TASK_ARG_FORCE_UTF8, loginCredentials.getForceUtf8())); loginCredentials.setProfileSql(getBooleanArgument(taskConfig, DatabaseConstants.TASK_ARG_PROFILE_SQL, loginCredentials.getProfileSql())); loginCredentials.setDbType(getStringArgument(taskConfig, DatabaseConstants.TASK_ARG_DB_TYPE, loginCredentials
loginCredentials.setPassword(getStringArgument(taskConfig, DatabaseConstants.TASK_ARG_PASSWORD, loginCredentials.getPassword())); loginCredentials.setForceUtf8(getBooleanArgument(taskConfig, DatabaseConstants.TASK_ARG_FORCE_UTF8, loginCredentials.getForceUtf8())); loginCredentials.setProfileSql(getBooleanArgument(taskConfig, DatabaseConstants.TASK_ARG_PROFILE_SQL, loginCredentials.getProfileSql())); loginCredentials.setDbType(getStringArgument(taskConfig, DatabaseConstants.TASK_ARG_DB_TYPE, loginCredentials