public Object getDriver ( String url , Properties props , String dataSourceID ) throws Exception { lock . readLock ( ) . lock ( ) ; try { if ( ! isInitialized ) try { // Switch to write lock for lazy initialization lock . readLock ( ) . unlock ( ) ; lock . writeLock ( ) . lock ( ) ; if ( ! isInitialized ) { if ( ! loadFromApp ( ) ) classloader = AdapterUtil . getClassLoaderWithPriv ( sharedLib ) ; isInitialized = true ; } } finally { // Downgrade to read lock for rest of method lock . readLock ( ) . lock ( ) ; lock . writeLock ( ) . unlock ( ) ; } final String className = ( String ) properties . get ( Driver . class . getName ( ) ) ; if ( className == null ) { String vendorPropertiesPID = props instanceof PropertyService ? ( ( PropertyService ) props ) . getFactoryPID ( ) : PropertyService . FACTORY_PID ; //if properties.oracle.ucp is configured do not search for driver impls because the customer has indicated //they want to use UCP, but this will likely pick up the Oracle driver instead of the UCP driver (since UCP has no Driver interface) if ( "com.ibm.ws.jdbc.dataSource.properties.oracle.ucp" . equals ( vendorPropertiesPID ) ) { throw new SQLNonTransientException ( AdapterUtil . getNLSMessage ( "DSRA4015.no.ucp.connection.pool.datasource" , dataSourceID , Driver . class . getName ( ) ) ) ; } } Driver driver = loadDriver ( className , url , classloader , props , dataSourceID ) ; if ( driver == null ) throw classNotFound ( Driver . class . getName ( ) , Collections . singleton ( "META-INF/services/java.sql.Driver" ) , dataSourceID , null ) ; return driver ; } finally { lock . readLock ( ) . unlock ( ) ; } }
Load the Driver instance for the specified URL .