package org.aksw.es.bsbmloader.connectionbuilder;



import org.apache.commons.cli.CommandLine;
import org.apache.metamodel.UpdateableDataContext;


public class ConnectionCreator {
	
	public UpdateableDataContext createConnection(CommandLine commandLine, String type) throws Exception {
		ConnectionDatabase connection = null;
		if (type != null && type.equals("mysql")) {
			connection = new ConnectionBuilder().createConnectionProperties("mysql");
			connection.setConnectionProperties(commandLine.getOptionValue("urlMysql"), commandLine.getOptionValue("u"),
					commandLine.getOptionValue("p"));
			return connection.getDB();
		}
		
		if (commandLine.hasOption("materializeMongo") || commandLine.hasOption("parseToMongo")) {
			connection = new ConnectionBuilder().createConnectionProperties("mongodb");
			connection.setConnectionProperties(commandLine.getOptionValue("hostNosql"),
					commandLine.getOptionValue("portNosql"));
			return connection.getDB();
		}

		return null;

	}
	 
}

@@ -880,22 +880,16 @@
 Nosql%22),
-%0A%09%09%09%09%09
 commandL
@@ -918,24 +918,104 @@
 rtNosql%22));%0A
+%09%09%09connection.setDatabaseName(commandLine.getOptionValue(%22databaseName%22));%0A%09%09%09%09%0A
 %09%09%09return co

Fix Errors