public static DataSource getDataSource(Map<?, ?> config) {
      String ignoreString = (String) config.remove(JdbcReaderFactoryParams.IGNORE);
      boolean ignore = !"false".equals(ignoreString);

      String dataSourceName = (String) config.remove(JdbcReaderFactoryParams.DATASOURCE);
      DataSource dataSource = null;
      if (dataSourceName != null) {
         dataSource = jndiDataSource(fixJndiName(dataSourceName));

         if (dataSource == null) {
            log.error("Data source {} not found.", dataSourceName);
            if (!ignore) {
               throw new IllegalArgumentException("No data source found.");
            }
         }
      } else {
         log.error("No data source configured.");
         if (!ignore) {
            throw new IllegalArgumentException("No data source configured.");
         }
      }

      return dataSource;
   }
public static DataSource getDataSource(Map<?, ?> config) {
      String ignoreString = (String) config.remove(JdbcReaderFactoryParams.IGNORE);
      boolean ignore = !"false".equals(ignoreString);

      String dataSourceName = (String) config.remove(JdbcReaderFactoryParams.DATASOURCE);
      DataSource dataSource = null;
      if (dataSourceName != null) {
         dataSource = jndiDataSource(fixJndiName(dataSourceName));

         if (dataSource == null) {
            log.error("Data source {} not found.", dataSourceName);
            if (!ignore) {
               throw new IllegalArgumentException("No data source found.");
            }
         }
      } else {
         log.error("No data source configured.");
         if (!ignore) {
            throw new IllegalArgumentException("No data source configured.");
         }
      }

      return dataSource;
   }
public static DataSource getDataSource ( Map < ? , ? > config ) { String ignoreString = ( String ) config . remove ( JdbcReaderFactoryParams . IGNORE ) ; boolean ignore = ! "false" . equals ( ignoreString ) ; String dataSourceName = ( String ) config . remove ( JdbcReaderFactoryParams . DATASOURCE ) ; DataSource dataSource = null ; if ( dataSourceName != null ) { dataSource = jndiDataSource ( fixJndiName ( dataSourceName ) ) ; if ( dataSource == null ) { log . error ( "Data source {} not found.", ataSourceName) ; if ( ! ignore ) { throw new IllegalArgumentException ( "No data source found." ) ; } } } else { log . error ( "No data source configured." ) ; if ( ! ignore ) { throw new IllegalArgumentException ( "No data source configured." ) ; } } return dataSource ; }
Lookup data source.

@param config
Configuration.
@return DataSource.
Lookup data source .