gpt4 book ai didi

org.apache.tomcat.jdbc.pool.XADataSource.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 07:06:40 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.tomcat.jdbc.pool.XADataSource.<init>()方法的一些代码示例,展示了XADataSource.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XADataSource.<init>()方法的具体详情如下:
包路径:org.apache.tomcat.jdbc.pool.XADataSource
类名称:XADataSource
方法名:<init>

XADataSource.<init>介绍

[英]Constructor for reflection only. A default set of pool properties will be created.
[中]构造函数仅用于反射。将创建一组默认的池属性。

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

public DataSource createDataSource(Properties properties,Context context, boolean XA) throws Exception {
  PoolConfiguration poolProperties = DataSourceFactory.parsePoolProperties(properties);
  if (poolProperties.getDataSourceJNDI()!=null && poolProperties.getDataSource()==null) {
    performJNDILookup(context, poolProperties);
  }
  org.apache.tomcat.jdbc.pool.DataSource dataSource = XA?
      new org.apache.tomcat.jdbc.pool.XADataSource(poolProperties) :
      new org.apache.tomcat.jdbc.pool.DataSource(poolProperties);
  //initialise the pool itself
  dataSource.createPool();
  // Return the configured DataSource instance
  return dataSource;
}

代码示例来源:origin: net.open-esb.runtime.standalone/openesb-standalone-container

@Override
public XADataSource getXADataSource(DataSourcePoolProperties dspProperties) {
  try {
    org.apache.tomcat.jdbc.pool.PoolProperties poolProperties = this.createNativeDataSource(dspProperties);
    org.apache.tomcat.jdbc.pool.XADataSource ds = new org.apache.tomcat.jdbc.pool.XADataSource(poolProperties);
    ds.setName(dspProperties.getDbConnectorName());
    registerMBean(ds);
    return ds;
  } catch (Exception ex) {
    LOG.log(Level.SEVERE, I18NBundle.getBundle().getMessage(
        LocalStringKeys.DS_UNABLE_TO_CREATE_DATASOURCE, dspProperties.getDbConnectorName()), ex);
    return null;
  }
}

代码示例来源:origin: org.beangle.tomcat/beangle-tomcat-core

@Override
public DataSource createDataSource(Properties properties, Context context, boolean XA) throws Exception {
 String url = (String) properties.get("url");
 if (null != url && url.startsWith("http")) properties.putAll(parse(getResponseText(new URL(url))));
 PoolConfiguration poolProperties = DataSourceFactory.parsePoolProperties(properties);
 String encodedPwd = poolProperties.getPassword();
 String keyName = poolProperties.getName().replace("/", "_") + "_secret";
 String secretKey = System.getenv(keyName);
 String password = null;
 if (encodedPwd.startsWith("?")) {
  if (null == secretKey) password = decryptByPrompt(keyName, encodedPwd.substring(1));
  else password = new Encryptor(secretKey).decrypt(encodedPwd.substring(1));
 } else {
  password = new Encryptor(secretKey).decrypt(encodedPwd);
 }
 poolProperties.setPassword(password);
 if (poolProperties.getDataSourceJNDI() != null && poolProperties.getDataSource() == null) {
  performJNDILookup(context, poolProperties);
 }
 if (XA) {
  XADataSource ds = new XADataSource(poolProperties);
  ds.createPool();
  return ds;
 } else {
  org.apache.tomcat.jdbc.pool.DataSource ds = new org.apache.tomcat.jdbc.pool.DataSource(poolProperties);
  ds.createPool();
  return ds;
 }
}

代码示例来源:origin: org.apache.tomcat/jdbc-pool

public DataSource createDataSource(Properties properties,Context context, boolean XA) throws Exception {
  PoolConfiguration poolProperties = DataSourceFactory.parsePoolProperties(properties);
  if (poolProperties.getDataSourceJNDI()!=null && poolProperties.getDataSource()==null) {
    performJNDILookup(context, poolProperties);
  }
  org.apache.tomcat.jdbc.pool.DataSource dataSource = XA?
      new org.apache.tomcat.jdbc.pool.XADataSource(poolProperties) :
      new org.apache.tomcat.jdbc.pool.DataSource(poolProperties);
  //initialise the pool itself
  dataSource.createPool();
  // Return the configured DataSource instance
  return dataSource;
}

代码示例来源:origin: org.apache.tomcat/com.springsource.org.apache.tomcat.jdbc

public DataSource createDataSource(Properties properties,Context context, boolean XA) throws Exception {
  PoolConfiguration poolProperties = DataSourceFactory.parsePoolProperties(properties);
  if (poolProperties.getDataSourceJNDI()!=null && poolProperties.getDataSource()==null) {
    performJNDILookup(context, poolProperties);
  }
  org.apache.tomcat.jdbc.pool.DataSource dataSource = XA?
      new org.apache.tomcat.jdbc.pool.XADataSource(poolProperties) :
      new org.apache.tomcat.jdbc.pool.DataSource(poolProperties);
  //initialise the pool itself
  dataSource.createPool();
  // Return the configured DataSource instance
  return dataSource;
}

代码示例来源:origin: org.apache.tomcat/tomcat-jdbc

public DataSource createDataSource(Properties properties,Context context, boolean XA) throws Exception {
  PoolConfiguration poolProperties = DataSourceFactory.parsePoolProperties(properties);
  if (poolProperties.getDataSourceJNDI()!=null && poolProperties.getDataSource()==null) {
    performJNDILookup(context, poolProperties);
  }
  org.apache.tomcat.jdbc.pool.DataSource dataSource = XA?
      new org.apache.tomcat.jdbc.pool.XADataSource(poolProperties) :
      new org.apache.tomcat.jdbc.pool.DataSource(poolProperties);
  //initialise the pool itself
  dataSource.createPool();
  // Return the configured DataSource instance
  return dataSource;
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com