Package javax.sql

Examples of javax.sql.CommonDataSource


        if (useContainerLoader) {
            Thread.currentThread().setContextClassLoader(DataSourceFactory.class.getClassLoader());
        }

        try {
            CommonDataSource ds;
            if (createDataSourceFromClass(impl)) { // opposed to "by driver"
                trimNotSupportedDataSourceProperties(properties);

                final ObjectRecipe recipe = new ObjectRecipe(impl);
                recipe.allow(Option.CASE_INSENSITIVE_PROPERTIES);
View Full Code Here


    private boolean logSql;

    public CommonDataSource create() {
        final TransactionManager transactionManager = OpenEJB.getTransactionManager();

        CommonDataSource cds = findDelegate();
        if (cds instanceof XADataSource) {
            cds = new ManagedXADataSource(cds, transactionManager);
        } else {
            cds = new ManagedDataSource(DataSource.class.cast(cds), transactionManager);
        }
View Full Code Here

    }

    @Override
    public DataSource poolManagedWithRecovery(final String name, final XAResourceWrapper xaResourceWrapper, final String driver, final Properties properties) {
        final TransactionManager transactionManager = new TransactionManagerWrapper(OpenEJB.getTransactionManager(), name, xaResourceWrapper);
        final CommonDataSource ds = pool(name, driver, properties);
        if (ds instanceof XADataSource) {
            return new ManagedXADataSource(ds, transactionManager);
        }
        return new ManagedDataSource(DataSource.class.cast(ds), transactionManager);
    }
View Full Code Here

        if (useContainerLoader) {
            Thread.currentThread().setContextClassLoader(DataSourceFactory.class.getClassLoader());
        }

        try {
            CommonDataSource ds;
            if (createDataSourceFromClass(impl)) { // opposed to "by driver"
                trimNotSupportedDataSourceProperties(properties);

                final ObjectRecipe recipe = new ObjectRecipe(impl);
                recipe.allow(Option.CASE_INSENSITIVE_PROPERTIES);
View Full Code Here

    @Test
    public void checkIt() throws IOException {
        assertThat(ds, instanceOf(Flushable.class));
        assertThat(ds, instanceOf(DataSource.class));
        final FlushableDataSourceHandler handler = FlushableDataSourceHandler.class.cast(Proxy.getInvocationHandler(ds));
        final CommonDataSource delegate = handler.getDelegate();
        assertNotNull(delegate);
        assertFalse(BasicDataSource.class.cast(delegate).isClosed());
        Flushable.class.cast(ds).flush();
        assertTrue(BasicDataSource.class.cast(delegate).isClosed());
        final CommonDataSource newDelegate = handler.getDelegate();
        assertFalse(BasicDataSource.class.cast(newDelegate).isClosed());
        assertNotSame(newDelegate, delegate);
    }
View Full Code Here

        if (useContainerLoader) {
            Thread.currentThread().setContextClassLoader(DataSourceFactory.class.getClassLoader());
        }

        try {
            CommonDataSource ds;
            if (createDataSourceFromClass(impl)) { // opposed to "by driver"
                trimNotSupportedDataSourceProperties(properties);

                final ObjectRecipe recipe = new ObjectRecipe(impl);
                recipe.allow(Option.CASE_INSENSITIVE_PROPERTIES);
View Full Code Here

                LOGGER.info("Can't use container loader to create datasource " + name + " so using application one");
            }
        }

        try {
            CommonDataSource ds;
            if (createDataSourceFromClass(impl)) { // opposed to "by driver"
                trimNotSupportedDataSourceProperties(properties);

                final ObjectRecipe recipe = new ObjectRecipe(impl);
                recipe.allow(Option.CASE_INSENSITIVE_PROPERTIES);
View Full Code Here

        if (useContainerLoader) {
            Thread.currentThread().setContextClassLoader(DataSourceFactory.class.getClassLoader());
        }

        try {
            CommonDataSource ds;
            if (createDataSourceFromClass(impl)) { // opposed to "by driver"
                trimNotSupportedDataSourceProperties(properties);

                final ObjectRecipe recipe = new ObjectRecipe(impl);
                recipe.allow(Option.CASE_INSENSITIVE_PROPERTIES);
View Full Code Here

        if (useContainerLoader) {
            Thread.currentThread().setContextClassLoader(DataSourceFactory.class.getClassLoader());
        }

        try {
            CommonDataSource ds;
            if (createDataSourceFromClass(impl)) { // opposed to "by driver"
                trimNotSupportedDataSourceProperties(properties);

                final ObjectRecipe recipe = new ObjectRecipe(impl);
                recipe.allow(Option.CASE_INSENSITIVE_PROPERTIES);
View Full Code Here

    }

    @Override
    public DataSource poolManagedWithRecovery(final String name, final XAResourceWrapper xaResourceWrapper, final String driver, final Properties properties) {
        final TransactionManager transactionManager = new TransactionManagerWrapper(OpenEJB.getTransactionManager(), name, xaResourceWrapper);
        final CommonDataSource ds = pool(name, driver, properties);
        if (ds instanceof XADataSource) {
            return new ManagedXADataSource(ds, transactionManager);
        }
        return new ManagedDataSource(DataSource.class.cast(ds), transactionManager);
    }
View Full Code Here

TOP

Related Classes of javax.sql.CommonDataSource

Copyright © 2018 www.massapicom. 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.