Examples of ConnectionFactory


Examples of org.apache.commons.dbcp2.ConnectionFactory

        // create a driver connection factory
        Properties properties = new Properties();
        properties.setProperty("user", "username");
        properties.setProperty("password", "password");
        ConnectionFactory connectionFactory = new DriverConnectionFactory(new TesterDriver(), "jdbc:apache:commons:testdriver", properties);

        // wrap it with a LocalXAConnectionFactory
        XAConnectionFactory xaConnectionFactory = new LocalXAConnectionFactory(transactionManager, connectionFactory);

        // create the pool object factory
View Full Code Here

Examples of org.apache.jackrabbit.core.util.db.ConnectionFactory

    public void testDerbyDatabasePersistenceManager() throws Exception {
        org.apache.jackrabbit.core.persistence.db.DerbyPersistenceManager manager =
            new org.apache.jackrabbit.core.persistence.db.DerbyPersistenceManager();
        manager.setDriver("org.apache.derby.jdbc.EmbeddedDriver");
        manager.setUrl("jdbc:derby:" + database.getPath() + ";create=true");
        manager.setConnectionFactory(new ConnectionFactory());
        assertPersistenceManager(manager);
    }
View Full Code Here

Examples of org.apache.ojb.broker.accesslayer.ConnectionFactory

                // Use OJB API to obtain JDBC Connection. All settings are read from
                // the repository.xml file.
                JdbcConnectionDescriptor jcd =
                        MetadataManager.getInstance().connectionRepository().getDescriptor(
                                TestHelper.DEF_KEY);
                ConnectionFactory cf =
                        ConnectionFactoryFactory.getInstance().createConnectionFactory();
                conn = cf.lookupConnection(jcd);
                System.out.println("] Waited for connection " + (System.currentTimeMillis() - startToWait) + "msecs");
                break;
            }
            catch (Throwable t)
            {
View Full Code Here

Examples of org.apache.tomcat.dbcp.dbcp.ConnectionFactory

    // Next, we'll create a ConnectionFactory that the
    // pool will use to create Connections.
    // We'll use the DriverManagerConnectionFactory,
    // using the connect string from configuration
    //
    ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(
        connectURI, username, password);

    //
    // Now we'll create the PoolableConnectionFactory, which wraps
    // the "real" Connections created by the ConnectionFactory with
View Full Code Here

Examples of org.castor.jdo.engine.ConnectionFactory

        return _jdo;
    }
   
    public Connection getJDBCConnection() throws SQLException {
        String name = _jdo.getDatabaseName();
        ConnectionFactory factory = null;
        try {
            factory = DatabaseRegistry.getConnectionFactory(name);
        } catch (MappingException ex) {
            throw new SQLException(Messages.format("jdo.dbNoMapping", name));
        }
        return factory.createConnection();
    }
View Full Code Here

Examples of org.datanucleus.ConnectionFactory

    return omfContext;
  }

  @Override
  public NucleusConnection getNucleusConnection(ObjectManager om) {
    ConnectionFactory cf = getOMFContext().getConnectionFactoryRegistry()
        .lookupConnectionFactory(txConnectionFactoryName);

    final ManagedConnection mc;
    final boolean enlisted;
    enlisted = om.getTransaction().isActive();
    mc = cf.getConnection(enlisted ? om : null, null); // Will throw exception if already locked

    // Lock the connection now that it is in use by the user
    mc.lock();

    Runnable closeRunnable = new Runnable() {
View Full Code Here

Examples of org.datanucleus.store.connection.ConnectionFactory

        }
        else
        {
            enlisted = true;
        }
        ConnectionFactory cf = null;
        if (enlisted)
        {
            cf = connectionMgr.lookupConnectionFactory(txConnectionFactoryName);
        }
        else
        {
            cf = connectionMgr.lookupConnectionFactory(nontxConnectionFactoryName);
        }
        mc = cf.getConnection(enlisted ? ec : null, ec.getTransaction(), null); // Will throw exception if already locked

        // Lock the connection now that it is in use by the user
        mc.lock();

        Runnable closeRunnable = new Runnable()
View Full Code Here

Examples of org.datanucleus.store.rdbms.datasource.dbcp.ConnectionFactory

            throw new SQLException("Transaction manager must be set before a connection can be created");
        }

        // If xa data source is not specified a DriverConnectionFactory is created and wrapped with a LocalXAConnectionFactory
        if (xaDataSource == null) {
            ConnectionFactory connectionFactory = super.createConnectionFactory();
            XAConnectionFactory xaConnectionFactory = new LocalXAConnectionFactory(getTransactionManager(), connectionFactory);
            transactionRegistry = xaConnectionFactory.getTransactionRegistry();
            return xaConnectionFactory;
        }
View Full Code Here

Examples of org.eclipse.jetty.server.ConnectionFactory

    public void benchmarkPushStrategy() throws Exception
    {
        InetSocketAddress address = startHTTPServer(version, new PushStrategyBenchmarkHandler(), 30000);

        // Plain HTTP
        ConnectionFactory factory = new HttpConnectionFactory(new HttpConfiguration());
        connector.setDefaultProtocol(factory.getProtocol());
        HttpClient httpClient = new HttpClient();
        // Simulate browsers, that open 6 connection per origin
        httpClient.setMaxConnectionsPerDestination(6);
        httpClient.start();
        benchmarkHTTP(httpClient);
        httpClient.stop();

        // First push strategy
        PushStrategy pushStrategy = new PushStrategy.None();
        factory = new HTTPSPDYServerConnectionFactory(version, new HttpConfiguration(), pushStrategy);
        connector.setDefaultProtocol(factory.getProtocol());
        Session session = startClient(version, address, new ClientSessionFrameListener());
        benchmarkSPDY(pushStrategy, session);
        session.goAway(new GoAwayInfo(5, TimeUnit.SECONDS));

        // Second push strategy
        pushStrategy = new ReferrerPushStrategy();
        factory = new HTTPSPDYServerConnectionFactory(version, new HttpConfiguration(), pushStrategy);
        connector.setDefaultProtocol(factory.getProtocol());
        session = startClient(version, address, new ClientSessionFrameListener());
        benchmarkSPDY(pushStrategy, session);
        session.goAway(new GoAwayInfo(5, TimeUnit.SECONDS));
    }
View Full Code Here

Examples of org.geotools.wfs.protocol.ConnectionFactory

        final String capsVersion = rootElement.getAttribute("version");
        final Version version = Version.find(capsVersion);

        if (Version.v1_0_0 == version) {
            final ConnectionFactory connectionFac = new DefaultConnectionFactory(tryGZIP, user,
                    pass, defaultEncoding, timeoutMillis);
            InputStream reader = new ByteArrayInputStream(wfsCapabilitiesRawData);
            final WFS100ProtocolHandler protocolHandler = new WFS100ProtocolHandler(reader,
                    connectionFac);
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.