Defines product data source (tag: data_source).

@param dataSource
product data source
@return a reference to this object.
769105
public ExtendedSwidProcessor setDataSource(final String dataSource) {
        swidTag.setDataSource(new Token(dataSource, idGenerator.nextId()));
        return this;
    }
73704
public void setDataSource(XADataSource dataSource) {
		this.dataSource = dataSource;
		setClassName(DirectXADataSource.class.getName());
		setDriverProperties(new Properties());
	}
9956
public SQLDialect determineSqlDialect(DataSource dataSource) {
		if (this.sqlDialect != null) {
			return this.sqlDialect;
		}
		return SqlDialectLookup.getDialect(dataSource);
	}
1079472
public GenericConnectionFactory cloneWith(DataSource datasource)
   {
      try
      {
         GenericConnectionFactory factory = (GenericConnectionFactory)this.clone();
         factory.dbDataSource = datasource;
         return factory;
      }
      catch (CloneNotSupportedException e)
      {
         throw new AssertionError(); // Cannot occur
      }
   }
641482
public static Database getDatabase(DataSource dataSource) {
		if (dataSource == null) {
			return Database.DEFAULT;
		}
		try {
			String url = JdbcUtils.extractDatabaseMetaData(dataSource, "getURL");
			DatabaseDriver driver = DatabaseDriver.fromJdbcUrl(url);
			Database database = LOOKUP.get(driver);
			if (database != null) {
				return database;
			}
		}
		catch (MetaDataAccessException ex) {
			logger.warn("Unable to determine jdbc url from datasource", ex);
		}
		return Database.DEFAULT;
	}
867729
public static boolean registerJdbcDataSource(String name, DataSource dataSource) {
        return jdbcDataSources.putIfAbsent(name, dataSource) == null;
    }
577201
public DataSource getDataSource() throws ConfigurationException {
        if (mDataSource == null) {
            if (mDriverClassName != null && mURL != null) {
                try {
                    mDataSource = new SimpleDataSource
                        (mDriverClassName, mURL, mUsername, mPassword);
                } catch (SQLException e) {
                    Throwable cause = e.getCause();
                    if (cause == null) {
                        cause = e;
                    }
                    throw new ConfigurationException(cause);
                }
            }
        }

        DataSource ds = mDataSource;
        if (getDataSourceLogging() && !(ds instanceof LoggingDataSource)) {
            ds = LoggingDataSource.create(ds);
        }

        return ds;
    }
1357060
public DataSource getDataSource() {
        if(dataSource == null) {
            LOG.info("Having to construct a new DataSource");

            dataSource = new DataSource();

            dataSource.setDriverClassName(dbSettings.getDriver());
            dataSource.setUrl(dbSettings.getJdbcUrl());
            dataSource.setUsername(dbSettings.getUser());
            dataSource.setPassword(dbSettings.getPass());

            dataSource.setMaxActive(dbSettings.getMaxActive());
            dataSource.setMaxIdle(dbSettings.getMaxIdle());
            dataSource.setMinIdle(dbSettings.getMinIdle());
            dataSource.setInitialSize(dbSettings.getInitialSize());
            dataSource.setTestOnBorrow(dbSettings.getTestOnBorrow());
            dataSource.setTestOnReturn(dbSettings.getTestOnReturn());
            dataSource.setTestWhileIdle(dbSettings.getTestWhileIdle());
            dataSource.setValidationQuery(dbSettings.getValidationQuery());
            dataSource.setLogValidationErrors(dbSettings.getLogValidationErrors());

            // a catch-all for any other properties that are needed
            dataSource.setDbProperties(dbSettings.getProperties());
        }

        return dataSource;
    }
496684
void addDataSource(DataSource dataSource) {
		if (dataSource == null) return;
		this.dataSources.add(new DataSourceDefinition(dataSource.name(), dataSource.driverClass(), dataSource.url(), dataSource.username(), dataSource.password()));
	}
1207219
public void setDataSource(DataSource dataSource) {
        mDataSource = dataSource;
        mDriverClassName = null;
        mURL = null;
        mUsername = null;
        mPassword = null;
    }
1503
function getDataSource(node) {
    const config = Object.assign({}, copyXmlAttributes(node));

    if (node.childNodes.length) {
        // parse datasource options
        for (let i = 0; i < node.childNodes.length; ++i) {
            const childNode = node.childNodes.item(i);

            if (childNode.nodeType === TEXT_NODE && childNode.textContent.trim().length > 0) {
                throw new ImplementationError(`dataSource contains useless text: "${childNode.textContent.trim()}"`);
            }

            if (
                childNode.nodeType === ELEMENT_NODE &&
                childNode.namespaceURI === 'urn:flora:options' &&
                childNode.localName === 'option'
            ) {
                if (childNode.attributes.length !== 1)
                    throw new Error('flora:option element requires a name attribute');

                const attr = childNode.attributes.item(0);
                if (attr.localName !== 'name') throw new Error('flora:option element requires a name attribute');
                if (config[attr.value]) throw new Error(`Data source option "${attr.value}" already defined`);

                config[attr.value] = childNode.textContent.trim();
            }
        }
    }

    const name = config.name ? config.name : 'primary';
    if (config.name) delete config.name;

    return { name, config };
}
361835
@Bean
    public DataSource dataSource() throws SQLException {
        if (null != masterSlaveProperties.getMasterDataSourceName()) {
            return MasterSlaveDataSourceFactory.createDataSource(dataSourceMap, masterSlaveSwapper.swap(masterSlaveProperties), propMapProperties.getProps());
        }
        if (!encryptProperties.getEncryptors().isEmpty()) {
            return EncryptDataSourceFactory.createDataSource(dataSourceMap.values().iterator().next(), encryptSwapper.swap(encryptProperties));
        }
        return ShardingDataSourceFactory.createDataSource(dataSourceMap, shardingSwapper.swap(shardingProperties), propMapProperties.getProps());
    }
568309
public DataSourceType<WebFragmentDescriptor> getOrCreateDataSource()
   {
      List<Node> nodeList = model.get("data-source");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new DataSourceTypeImpl<WebFragmentDescriptor>(this, "data-source", model, nodeList.get(0));
      }
      return createDataSource();
   }
118913
public void addDataSource(int groupno, DataSource datasource) {
    // the loader takes care of validation
    if (groupno == 0)
      datasources.add(datasource);
    else if (groupno == 1)
      group1.add(datasource);
    else if (groupno == 2)
      group2.add(datasource);
  }
801072
public static DataSource createDataSource(String source){
		String typeAndConfig = configuration.getProperty(source);
		if (typeAndConfig == null){
			log.error("No configuration for data source: " + source);
			return null;
		}
		String[] typeAndConfigArray = typeAndConfig.split(DELIMITORS, 2);
		if (typeAndConfigArray.length < 2){
			log.error("Wrong configuration format for data source '" + source + "': " + typeAndConfig);
			return null;
		}
		String type = typeAndConfigArray[0];
		String config = typeAndConfigArray[1];
		return createDataSource(source, type, config);
	}
12759
public static DataSource getDataSource(Connection conn) {
        if (conn == null) {
            return null;
        }
        String dsName = openConnDsName.get().get(conn);
        return getJdbcDataSource(dsName);
    }
513624
public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            foreach ($dataSource['data']['items'] as & $item) {
                if (isset($item['stockist_id'])) {
                    $item[$this->getData('name')] = [
                        'edit' => [
                            'href' => $this->_urlBuilder->getUrl(
                                static::URL_PATH_EDIT,
                                [
                                    'stockist_id' => $item['stockist_id']
                                ]
                            ),
                            'label' => __('Edit')
                        ],
                        'delete' => [
                            'href' => $this->_urlBuilder->getUrl(
                                static::URL_PATH_DELETE,
                                [
                                    'stockist_id' => $item['stockist_id']
                                ]
                            ),
                            'label' => __('Delete'),
                            'confirm' => [
                                'title' => __('Delete "${ $.$data.name }"'),
                                'message' => __('Are you sure you wan\'t to delete the Store "${ $.$data.name }" ?')
                            ]
                        ]
                    ];
                }
            }
        }
        return $dataSource;
    }