@SuppressWarnings("unused")
	private static java.sql.Connection connect2(String endpoint, String driver,
			String user, String pwd) {

		try {
			Class.forName(driver);
		} catch (ClassNotFoundException e) {
			LogHandler.writeStackTrace(Logger.getGlobal(), e, Level.SEVERE);
			return null;
		}

		java.sql.Connection con = null;
		try {
			if (user != null && pwd != null) {
				// Connects with the given jdbcURL as user with pwd

				con = DriverManager.getConnection(jdbcPrefix + endpoint, user,
						pwd);

				// AS some Triplestores can't connect as a user without setting
				// the user explicit we need this
				if (con instanceof SPARQLConnection) {
					((SPARQLConnection) con).setUsername(user);
				}
			} else {
				// Connects with the given jdbcURL
				con = DriverManager.getConnection(jdbcPrefix + endpoint);

			}
		} catch (SQLException e) {
			LogHandler.writeStackTrace(Logger.getGlobal(), e, Level.SEVERE);
			return null;
		}
		return con;
	}