Examples of TAtomDataSource


Examples of com.taobao.tddl.jdbc.atom.TAtomDataSource

  protected static JdbcTemplate tddlJT;
  protected static TAtomDataSource tds;

  @BeforeClass
  public static void setUp() throws Exception {
    tds = new TAtomDataSource();
    tds.setAppName(APPNAME);
    tds.setDbKey(DBKEY_0);
    tds.init();
    tddlJT = getJT();
  }
View Full Code Here

Examples of com.taobao.tddl.jdbc.atom.TAtomDataSource

  protected static JdbcTemplate getJT() {
    return new JdbcTemplate(tds);
  }

  protected static JdbcTemplate getJT(String path, String appName, String dbKey) throws Exception {
    TAtomDataSource atomDs = new TAtomDataSource();
    atomDs.setAppName(appName);
    atomDs.setDbKey(dbKey);
    atomDs.init();
    return new JdbcTemplate(atomDs);
  }
View Full Code Here

Examples of com.taobao.tddl.jdbc.atom.TAtomDataSource

   * ��Ϊ���ǵĵ�Group�����У����õ�AtomDataSource���������DataSource��dbkey��ʾ
   * ���ԣ�������Ҫ�����dbkey��Diamond��ȡ�����Ƕ�Ӧ��������Ϣ����������������AtomDataSource ---add by
   * mazhidan.pt
   */
  private TAtomDataSource createTAtomDataSource(String dsKey) {
    TAtomDataSource ads = null;
    try {
      ads = new TAtomDataSource();
      ads.setAppName(tGroupDataSource.getAppName());
      ads.setDbKey(dsKey);

      ads.init(); // TAtomDataSource��init()��throws Exception

      ads.setLogWriter(tGroupDataSource.getLogWriter());
      ads.setLoginTimeout(tGroupDataSource.getLoginTimeout());
    } catch (Exception e) {
      throw new TAtomDataSourceException("TAtomDataSource�޷���ʼ��: dsKey="
          + dsKey, e);
    }
    return ads;
View Full Code Here

Examples of com.taobao.tddl.jdbc.atom.TAtomDataSource

      if (dsw != null) {
        dbType = dsw.getDBType();
        return dsw.getWrappedDataSource();
      } else {
        if (createTAtomDataSource) {
          TAtomDataSource atom = createTAtomDataSource(dsKey);
          dbType = DBType.valueOf(atom.getDbType().name());
          return atom;
        } else {
          throw new IllegalArgumentException(dsKey + " not exist!");
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.