Examples of JdbcDataSource


Examples of com.alibaba.wasp.jdbcx.JdbcDataSource

    Class.forName("com.alibaba.wasp.jdbc.Driver");

    conf = TEST_UTIL.getConfiguration();
    conf.setInt(FConstants.JDBC_POOL_MAX_CONNECTIONS, 3);

    pool = JdbcConnectionPool.create(new JdbcDataSource(conf), conf);
  }
View Full Code Here

Examples of com.alibaba.wasp.jdbcx.JdbcDataSource

      }
    } catch (SQLException e) {
      assertTrue(e.getMessage().indexOf("get connection timeout") != -1);
    }

    pool = JdbcConnectionPool.create(new JdbcDataSource(conf), conf);
    for (int i = 0; i < 5; i++) {
      Connection conn = pool.getConnection();
      conn.close();
    }
View Full Code Here

Examples of com.volantis.synergetics.reporting.config.JDBCDatasource

     * @throws JiBXException if unmarshalling failed
     */
    private DatasourceConfiguration unmarshalJDBCDatasource(
            UnmarshallingContext ctx) throws JiBXException {
       
        JDBCDatasource source = new JDBCDatasource();
        ctx.parsePastStartTag(ctx.getNamespace(),
                JDBC_DATASOURCE_TAG_NAME);
   
        source.setDriverClass(
                getTagsTextContent(ctx, DRIVER_CLASS_TAG_NAME));
        source.setConnectionString(
                getTagsTextContent(ctx, CONNECTION_STRING_TAG_NAME));
   
        unmarshalName(ctx, source);
       
        ctx.toEnd();
View Full Code Here

Examples of com.volantis.synergetics.reporting.config.JDBCDatasource

            throws JiBXException {
        MarshallingContext ctx = (MarshallingContext) context;
        DatasourceConfiguration dataSource = (DatasourceConfiguration) arg0;
        DataSourceType type = dataSource.getType();
        if (type == DataSourceType.JDBC_DATASOURCE) {
            JDBCDatasource jdbcDatasource = (JDBCDatasource) dataSource;
            ctx.startTag(index, JDBC_DATASOURCE_TAG_NAME);

            writeTagsTextContent(ctx, DRIVER_CLASS_TAG_NAME,
                    jdbcDatasource.getDriverClass());
            writeTagsTextContent(ctx, CONNECTION_STRING_TAG_NAME,
                    jdbcDatasource.getConnectionString());

            marshalName(index, ctx, jdbcDatasource.getName());
           
            ctx.endTag(index, JDBC_DATASOURCE_TAG_NAME);             
        } else if (type == DataSourceType.INTERNAL_POOL_DATASOURCE) {
            InternalPoolDatasource internalPoolDatasource =
                (InternalPoolDatasource) dataSource;  
View Full Code Here

Examples of com.volantis.synergetics.reporting.config.JDBCDatasource

        DatasourceConfiguration datasource = parseDatasource(
                new ByteArrayInputStream(ANONYMOUS_JDBC_DATASOURCE.getBytes()));

        assertEquals(DataSourceType.JDBC_DATASOURCE, datasource.getType());
       
        JDBCDatasource jdbcDatasource = (JDBCDatasource) datasource;
       
        assertEquals("org.gjt.mm.mysql.Driver", jdbcDatasource.getDriverClass());
        assertEquals("jdbc:mysql://127.0.0.1/logging?user=logger&password=logpass&database=logging",
                jdbcDatasource.getConnectionString());       
       
    }
View Full Code Here

Examples of no.priv.garshol.duke.datasources.JDBCDataSource

                                attributes.getValue("lookup").toUpperCase());
      } else if (localName.equals("csv")) {
        datasource = new CSVDataSource();
        currentobj = datasource;
      } else if (localName.equals("jdbc")) {
        datasource = new JDBCDataSource();
        currentobj = datasource;
      } else if (localName.equals("jndi")) {
        datasource = new JNDIDataSource();
        currentobj = datasource;
      } else if (localName.equals("sparql")) {
View Full Code Here

Examples of org.glassfish.jdbcruntime.service.JdbcDataSource

     *
     * @param resourceInfo the jndi name of the resource
     * @return DataSource representing the resource.
     */
    public Object lookupDataSourceInDAS(ResourceInfo resourceInfo) throws ConnectorRuntimeException {
        JdbcDataSource myDS = new JdbcDataSource();
        myDS.setResourceInfo(resourceInfo);
        return myDS;
    }
View Full Code Here

Examples of org.h2.jdbcx.JdbcDataSource

            public byte[] getBranchQualifier() {
                return new byte[] { 34, 43, 33, 3, 3, 3, 33, 33, 3 };
            }
        };
        deleteDb("xa");
        JdbcDataSource ds = new JdbcDataSource();
        ds.setURL(getURL("xa", true));
        ds.setPassword(getPassword());
        Connection dm = ds.getConnection();
        Statement stat = dm.createStatement();
        stat.execute("CREATE TABLE IF NOT EXISTS TEST(ID INT PRIMARY KEY, VAL INT)");
        stat.execute("INSERT INTO TEST(ID,VAL) VALUES (1,1)");
        dm.close();
        XAConnection c = ds.getXAConnection();
        XAResource xa = c.getXAResource();
        Connection connection = c.getConnection();
        xa.start(xid, XAResource.TMJOIN);
        PreparedStatement ps = connection.prepareStatement("UPDATE TEST SET VAL=? WHERE ID=?");
        ps.setInt(1, new Random().nextInt());
View Full Code Here

Examples of org.h2.jdbcx.JdbcDataSource

        c.close();
        deleteDb("xa");
    }

    private void testMixedXaNormal() throws Exception {
        JdbcDataSource ds = new JdbcDataSource();
        ds.setURL("jdbc:h2:mem:test");
        ds.setUser("sa");
        ds.setPassword("");
        XAConnection xa = ds.getXAConnection();
        Connection c = xa.getConnection();
        assertTrue(c.getAutoCommit());
        MyXid xid = new MyXid();
        XAResource res = xa.getXAResource();
View Full Code Here

Examples of org.h2.jdbcx.JdbcDataSource

            return globalTransactionId;
        }
    }

    private void testXAAutoCommit() throws Exception {
        JdbcDataSource ds = new JdbcDataSource();
        ds.setURL("jdbc:h2:mem:test");
        ds.setUser("sa");
        ds.setPassword("");
        XAConnection xa = ds.getXAConnection();
        MyXid xid = new MyXid();
        xa.getXAResource().start(xid,
                XAResource.TMNOFLAGS);
        Connection c = xa.getConnection();
        assertTrue(!c.getAutoCommit());
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.