classPathEntries.add( new URL( "file: + escapeCharacters( st.nextToken( ) ) ) );
classPathEntries.add( new URL( "file", null, -1, escapeCharacters( st.nextToken( ) ) ) );
	public static Connection getConnection( String driverClassName,			String classPath, String connectionString, String userId,			String password ) throws SQLException	{		try		{			// ASSUMPTION			// All the directories in the driverClassName are delimited by the			// ";" character			ArrayList classPathEntries = null;			if ( classPath != null )			{				classPathEntries = new ArrayList( );				StringTokenizer st = new StringTokenizer( classPath, ";" ); //$NON-NLS-1$				while ( st.hasMoreTokens( ) )				{					classPathEntries.add( new URL( "file:///" //$NON-NLS-1$							+ escapeCharacters( st.nextToken( ) ) ) );				}			}			URL[] urlClasspath = new URL[classPathEntries.size( )];//(URL[])			// (classPathEntries.toArray(			// URL[] ));			for ( int i = 0; i < classPathEntries.size( ); i++ )			{				urlClasspath[i] = (URL) classPathEntries.get( i );			}			URLClassLoader ucl = new URLClassLoader( urlClasspath );			if ( driverClassName != null && ucl != null )			{                Connection connection = null;                try                {                    connection = DriverManager.getConnection( connectionString,                            userId,                            password );                }                catch(Exception ex)                {                    //Just ignore this                    //this will happen if the driver is not registered                }                Driver d = null;                if(connection == null)                {                    //if the connection is null                    //we try instantiating the driver                    d = (Driver) Class.forName( driverClassName, true, ucl )                    .newInstance( );                                        try                    {                        //Now get the connection again                        connection = DriverManager.getConnection( connectionString,                                userId,                                password );                    }                    catch(Exception ex)                    {                        //Ignore this exception as well                        //We will have to register the driver and try                    }                                    }                                if(connection == null)                {                    DriverManager.registerDriver( new DriverExt( d ) );                    connection = DriverManager.getConnection( connectionString,                            userId,                            password );                }                				return connection;			}		}		catch ( MalformedURLException e )		{			ExceptionHandler.handle( e );		}        catch (InstantiationException e)        {            ExceptionHandler.handle( e );        }        catch (IllegalAccessException e)        {            ExceptionHandler.handle( e );        }        catch (ClassNotFoundException e)        {            ExceptionHandler.handle( e );        }		return null;	}