Map preferenceMap = Utility.getPreferenceStoredMap( JdbcPlugin.DRIVER_MAP_PREFERENCE_KEY );  for ( Iterator itr = jdbcDriverInfos.iterator( ); itr.hasNext( ); ) { JDBCDriverInformation info = (JDBCDriverInformation) itr.next( );  Object ob = preferenceMap.get( info.toString( ) ); if ( ob != null ) { DriverInfo driverInfo = (DriverInfo) ob; if ( driverInfo.getDisplayName( ) != null && driverInfo.getDisplayName( ).length( ) > 0 ) { info.setDisplayName( driverInfo.getDisplayName( ) ); } if ( driverInfo.getUrlTemplate( ) != null && driverInfo.getUrlTemplate( ).length( ) > 0 ) { info.setUrlFormat( driverInfo.getUrlTemplate( ) ); } } }
resetPreferences( );
	public static List getJdbcDriversFromODADir( String driverName )	{		if ( jdbcDriverInfos != null )		{			// remove the forged driver if exists			if ( !driverNameMap.containsValue( jdbcDriverInfos.get( 0 ) ) )				jdbcDriverInfos.remove( 0 );			return jdbcDriverInfos;		}				jdbcDriverInfos = new ArrayList( );		driverNameMap = new HashMap();		file2Drivers = new Hashtable( );		// Get drivers from drivers subdirectory		addDriversFromFiles( );		final String ODBCJDBCDriverName = "sun.jdbc.odbc.JdbcOdbcDriver";		JDBCDriverInformation ODBCJDBCInfo = null; 				// Merge drivers from the driverInfo extension point		JDBCDriverInformation driverInfos[] = JDBCDriverInfoManager.getDrivers();		for (int i = 0; i < driverInfos.length; i++)		{			JDBCDriverInformation newInfo = driverInfos[i];			// If driver already found in last step, update it; otherwise add new			JDBCDriverInformation existing = 					(JDBCDriverInformation)	driverNameMap.get( newInfo.getDriverClassName());			if ( existing == null )			{				if ( newInfo.getDriverClassName( )						.equalsIgnoreCase( ODBCJDBCDriverName ) )				{					ODBCJDBCInfo = newInfo;					continue;				}				jdbcDriverInfos.add( newInfo );				driverNameMap.put( newInfo.getDriverClassName(), newInfo);			}			else			{				existing.setDisplayName( newInfo.getDisplayName());				existing.setUrlFormat( newInfo.getUrlFormat());			}		}				// Put ODBC-JDBC driver to the last posistion of list		if ( ODBCJDBCInfo != null )		{			jdbcDriverInfos.add( ODBCJDBCInfo );			driverNameMap.put( ODBCJDBCInfo.getDriverClassName( ), ODBCJDBCInfo );		}				// Read user setting from the preference store and update		Map preferenceMap = Utility.getPreferenceStoredMap( JdbcPlugin.DRIVER_MAP_PREFERENCE_KEY );		for ( Iterator itr = jdbcDriverInfos.iterator( ); itr.hasNext( ); )		{			JDBCDriverInformation info = (JDBCDriverInformation) itr.next( );							Object ob = preferenceMap.get( info.toString( ) );			if ( ob != null )			{				DriverInfo driverInfo = (DriverInfo) ob;				if ( driverInfo.getDisplayName( ) != null						&& driverInfo.getDisplayName( ).length( ) > 0 )				{					info.setDisplayName( driverInfo.getDisplayName( ) );				}				if ( driverInfo.getUrlTemplate( ) != null						&& driverInfo.getUrlTemplate( ).length( ) > 0 )				{					info.setUrlFormat( driverInfo.getUrlTemplate( ) );				}			}		}				return jdbcDriverInfos;	}