Examples of XADataSource


Examples of COM.cloudscape.core.XaDataSource

    public synchronized XADataSource getDataSource (String dbName, boolean create) throws SQLException
    {
  try
  {
      XaDataSource xads = (COM.cloudscape.core.XaDataSource) DataSourceFactory.getXADataSource();
      int index1 = dbName.indexOf(cloudscape_3_6.driverName);

      if (index1 == -1)
    throw new SQLException("cloudscape_3_6.getDataSource - "+jdbcLogger.logMesg.getString("com.arjuna.ats.internal.jdbc.drivers.invaliddb")+" Cloudscape");
      else
      {
    /*
     * Strip off any spurious parameters.
     */

    int index2 = dbName.indexOf(cloudscape_3_6.semicolon);
    String theDbName = null;

    if (index2 == -1)
    {
        theDbName = dbName.substring(index1+cloudscape_3_6.driverName.length());
    }
    else
    {
        theDbName = dbName.substring(index1+cloudscape_3_6.driverName.length(),index2);
    }

    /*
     * At present cloudscape does not allow remote
     * XA connections. So, we know the thing after the :
     * in the 'url' must be the database name. If this
     * restriction changes, we'll need to determine the
     * server name, port, and database name some other
     * way.
     */

    xads.setDatabaseName(theDbName);

    if (create)
        xads.setCreateDatabase("create");
     
    return (XADataSource) xads;
      }
  }
  catch (SQLException e1)
View Full Code Here

Examples of javax.sql.XADataSource

        Connection conn2 = null;
        Statement stat1 = null;
        Statement stat2 = null;
        try {
            trace("xads1 = createXADatasource1()");
            XADataSource xaDs1 = createXADatasource(useOneDatabase, url1);
            trace("xads2 = createXADatasource2()");
            XADataSource xaDs2 = createXADatasource(useOneDatabase, url2);

            trace("xacon1 = xads1.getXAConnection()");
            xaConn1 = xaDs1.getXAConnection();
            trace("xacon2 = xads2.getXAConnection()");
            xaConn2 = xaDs2.getXAConnection();

            trace("xares1 = xacon1.getXAResource()");
            XAResource xares1 = xaConn1.getXAResource();
            trace("xares2 = xacon2.getXAResource()");
            XAResource xares2 = xaConn2.getXAResource();
View Full Code Here

Examples of javax.sql.XADataSource

           properties.setProperty("Password", CrashHelper.DS_PASSWORD);
        }
        // end of hack

        Class clazz = Thread.currentThread().getContextClassLoader().loadClass(xaDataSourceClassname);
        XADataSource xads = (XADataSource) clazz.newInstance();
        Class[] NOCLASSES = new Class[] {};
        for (Iterator i = properties.keySet().iterator(); i.hasNext();)
        {
            String name = (String) i.next();
            String value = properties.getProperty(name);
View Full Code Here

Examples of javax.sql.XADataSource

            int urlEnd = urlsStr.indexOf(urlDelimiter);
            while(urlEnd > 0)
            {
               String url = urlsStr.substring(urlStart, urlEnd);
               xaPropsCopy.setProperty(urlProperty, url);
               XADataSource xads = createXaDataSource(xaPropsCopy);
               xaDataList.add(new XAData(xads, url));
               urlStart = ++urlEnd;
               urlEnd = urlsStr.indexOf(urlDelimiter, urlEnd);
               log.debug("added XA HA connection url: " + url);
            }

            if(urlStart != urlsStr.length())
            {
               String url = urlsStr.substring(urlStart, urlsStr.length());
               xaPropsCopy.setProperty(urlProperty, url);
               XADataSource xads = createXaDataSource(xaPropsCopy);
               xaDataList.add(new XAData(xads, url));
               log.debug("added XA HA connection url: " + url);
            }
      if(getUrlSelectorStrategyClassName()==null)
      {
View Full Code Here

Examples of javax.sql.XADataSource

   if(getXADataSourceClass() == null)
   {
      throw new JBossResourceException("No XADataSourceClass supplied!");
   }

   XADataSource xads;
   try
   {
      Class clazz = Thread.currentThread().getContextClassLoader().loadClass(getXADataSourceClass());
      xads = (XADataSource)clazz.newInstance();
      Class[] NOCLASSES = new Class[]{};
View Full Code Here

Examples of javax.sql.XADataSource

        if (getSystemProperty("os.name").startsWith("OS/400")) {
            return;
        }
       
        // Test chinese database name.
        XADataSource ds = J2EEDataSource.getXADataSource();
        J2EEDataSource.setBeanProperty(ds, "databaseName", "\u4e10");
        J2EEDataSource.setBeanProperty(ds, "createDatabase", "create");       

        XAConnection xaconn = ds.getXAConnection();
        Connection conn = xaconn.getConnection();
        conn.close();
 
        // Chinese user
        J2EEDataSource.setBeanProperty(ds, "user", "\u4e10");
        xaconn = ds.getXAConnection();
        conn = xaconn.getConnection();
        conn.close();

        // Chinese password
        J2EEDataSource.setBeanProperty(ds, "password", "\u4e10");
        xaconn = ds.getXAConnection();
        conn = xaconn.getConnection();
        conn.close();
       
        /* Add the created database for cleanup by tearDown() */
        databasesForCleanup.add("\u4e10");
View Full Code Here

Examples of javax.sql.XADataSource

    poolingDSs = new ArrayList<PoolingDataSource>();
    tm = TransactionManagerServices.getTransactionManager();

    // in test DS setup
    {
      final XADataSource realInTestDs = (XADataSource) P6Util.forName(
          testOptions.getXaDataSource().getClass().getName()).newInstance();
      setXADSProperties(realInTestDs, testOptions.getUrl().replace(":p6spy", ""),
          testOptions.getUser(), testOptions.getPassword());
      jndiResources.add(new Resource("jdbc/realInTestDs", realInTestDs));

      final PoolingDataSource inTestDs = new PoolingDataSource();
      inTestDs.setClassName(P6DataSource.class.getName());
      inTestDs.setUniqueName("jdbc/inTestDs");
      inTestDs.setMaxPoolSize(10);
      inTestDs.getDriverProperties().setProperty("realDataSource", "jdbc/realInTestDs");
      inTestDs.setAllowLocalTransactions(true);
      inTestDs.init();
      jndiResources.add(new Resource("jdbc/inTestDs", inTestDs));
      poolingDSs.add(inTestDs);
    }

    // fixed DS setup
    {
      final XADataSource realFixedDs = (XADataSource) P6Util.forName("org.h2.jdbcx.JdbcDataSource")
          .newInstance();
      setXADSProperties(realFixedDs, "jdbc:h2:mem:p6spy_realFixedDs", "sa", "sa");
      jndiResources.add(new Resource("jdbc/realFixedDs", realFixedDs));

      final PoolingDataSource fixedDs = new PoolingDataSource();
View Full Code Here

Examples of javax.sql.XADataSource

        showHoldStatus("initial ", dmc);
       
        XATestUtil.createXATransactionView(dmc);
        dmc.close();

        XADataSource dsx = TestUtil.getXADataSource(cleanProperties());

        // tests originally from xaSimplePositive.sql
        singleConnectionOnePhaseCommit(dsx);
        xaShutdown();
        interleavingTransactions(dsx);
View Full Code Here

Examples of javax.sql.XADataSource

        if (TestUtil.isEmbeddedFramework())
            dsAttrs.put("shutdownDatabase", "shutdown");
        else
            dsAttrs.put("connectionAttributes", "shutdown=true");

        XADataSource dsx = TestUtil.getXADataSource(dsAttrs);

        try {
            dsx.getXAConnection().getConnection();
        } catch (SQLException sqle) {
            if ("08006".equals(sqle.getSQLState()))
                return;
            TestUtil.dumpSQLExceptions(sqle);
        }
View Full Code Here

Examples of javax.sql.XADataSource

      ij.getPropertyArg(args)
      ij.startJBMS().close();
    // Test connections obtained via XADataSource DERBY-898/899
    Properties dsprops = new Properties();
    dsprops.setProperty("databaseName","wombat");
    XADataSource ds  = TestUtil.getXADataSource(dsprops);
    con = ds.getXAConnection().getConnection();
    con2 = ds.getXAConnection().getConnection();
   
    runTests("connections from XADataSource (local tranasaction)",
         con, con2);
    con.close();
    con2.close();
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.