for ( int i = 0; i < driverFiles.length; i++ ) { try { urlList[i] = new URL( "file: + driverFiles[i].getAbsolutePath( ) ); jdbcDriverLocations.add( driverFiles[i].getAbsolutePath( ) ); } catch ( MalformedURLException e ) { ExceptionHandler.handle( e ); }
if ( driverFiles != null ) { URL[] urlList = new URL[driverFiles.length];
	public static ArrayList getJdbcDriverNames( String driverName )	{		if ( jdbcDrivers == null )		{			jdbcDrivers = new ArrayList( );            URL[] classPathURLs = getJdbcDriverClassPathURLS(driverName);			try			{                JDBCDriverInformation info = JDBCDriverInformation.getInstance("sun.jdbc.odbc.JdbcOdbcDriver", classPathURLs);				// Adding the odbc-jdbc driver                info.setUrlFormat("jdbc:odbc:<data source name>");				jdbcDrivers.add( info ); //$NON-NLS-1$			}			catch ( Exception e )			{			}            JdbcDriverConfigUtil driverConfigUtil = null;			File[] driverFiles = null;			try			{				driverConfigUtil = new JdbcDriverConfigUtil( driverName );				driverFiles = driverConfigUtil.getDriverFiles( );			}			catch ( Exception e )			{				ExceptionHandler.handle( e );			}			Class aClass = null;			jdbcDriverLocations = new ArrayList( );                        if(driverFiles != null)            {                URL[] urlList = new URL[driverFiles.length];                // Create a URL Array for the class loader to use                for ( int i = 0; i < driverFiles.length; i++ )                {                    try                    {                        urlList[i] = new URL( "file:///" //$NON-NLS-1$                                + driverFiles[i].getAbsolutePath( ) );                        jdbcDriverLocations.add( driverFiles[i].getAbsolutePath( ) );                    }                    catch ( MalformedURLException e )                    {                        ExceptionHandler.handle( e );                    }                }                URLClassLoader urlClassLoader = new URLClassLoader( urlList,                        ClassLoader.getSystemClassLoader( ) );                for ( int i = 0; i < driverFiles.length; i++ )                {                    if ( driverFiles[i].getName( ).endsWith( ".jar" ) ) //$NON-NLS-1$                    {                        try                        {                            String[] resourceNames = getJarFileEntries( driverFiles[i] );                            for ( int j = 0; j < resourceNames.length; j++ )                            {                                String resourceName = resourceNames[j];                                if ( resourceName.endsWith( ".class" ) ) //$NON-NLS-1$                                {                                    try                                    {                                        resourceName = ( resourceName.replaceAll( "/", //$NON-NLS-1$                                                "." ) ).substring( 0, //$NON-NLS-1$                                                resourceName.length( ) - 6 );                                        aClass = urlClassLoader.loadClass( resourceName );                                    }                                    catch ( Throwable e )                                    {                                    }                                    if ( aClass != null )                                    {                                        if ( implementsSQLDriver( aClass ) )                                        {                                            // Do not add it, if it is a Abstract                                            // class                                            int modifier = aClass.getModifiers( );                                            boolean isAbstract = Modifier.isAbstract( modifier );                                            if ( !isAbstract )                                            {                                                JDBCDriverInformation info = JDBCDriverInformation.getInstance(aClass, classPathURLs);                                                if(driverConfigUtil != null)                                                {                                                    info.setUrlFormat(driverConfigUtil.getURLFormat(info.getDriverClassName()));                                                }                                                jdbcDrivers.add( info );                                            }                                        }                                    }                                }                            }                        }                        catch ( Throwable e )                        {                        }                    }                }            }		}		return jdbcDrivers;	}