Examples of DbConnectionFactory


Examples of org.apache.hadoop.raid.DBConnectionFactory

          SimpleDBConnectionFactory.class);
      if (DBFactoryClass == null) {
        throw new IOException("Connection factory key: " +
            DBUtils.RAID_DB_CONNECTION_FACTORY_CLASS_KEY + " is not set!");
      }
      DBConnectionFactory connectionFactory =
          (DBConnectionFactory) ReflectionUtils.newInstance(DBFactoryClass,
                                                            conf);
      connectionFactory.initialize(conf);
      return connectionFactory;
    }
View Full Code Here

Examples of org.mule.module.db.internal.domain.connection.DbConnectionFactory

    }

    @Test
    public void testRejectsNonSupportedSql() throws Exception
    {
        DbConnectionFactory dbConnectionFactory = mock(DbConnectionFactory.class);

        for (QueryType type : QueryType.values())
        {
            QueryTemplate queryTemplate = new QueryTemplate("UNUSED SQL TEXT", type, Collections.<QueryParam>emptyList());
View Full Code Here

Examples of org.mule.module.db.internal.domain.connection.DbConnectionFactory

    @Test
    public void testCommitsWorkIfNoTransactionDefined() throws Exception
    {
        DbConnection connection = mock(DbConnection.class);
        DbConnectionFactory dbConnectionFactory = mock(DbConnectionFactory.class);
        when(dbConnectionFactory.createConnection(TransactionalAction.JOIN_IF_POSSIBLE)).thenReturn(connection);
        SelectExecutor selectExecutor = mock(SelectExecutor.class);

        SelectMessageProcessor processor = new SelectMessageProcessor(null, null, null, null, false);
        MuleEvent event = mock(MuleEvent.class);
        MuleMessage muleMessage = mock(MuleMessage.class);
View Full Code Here

Examples of org.mule.module.db.internal.domain.connection.DbConnectionFactory

    }

    @Test
    public void testRejectsNonSupportedSql() throws Exception
    {
        DbConnectionFactory dbConnectionFactory = mock(DbConnectionFactory.class);

        for (QueryType type : QueryType.values())
        {
            QueryTemplate queryTemplate = new QueryTemplate("UNUSED SQL TEXT", type, Collections.<QueryParam>emptyList());
View Full Code Here

Examples of org.mule.module.db.internal.domain.connection.DbConnectionFactory

    @Test
    public void testCommitsWorkIfNoTransactionDefined() throws Exception
    {
        DbConnection connection = mock(DbConnection.class);
        DbConnectionFactory dbConnectionFactory = mock(DbConnectionFactory.class);
        when(dbConnectionFactory.createConnection(TransactionalAction.JOIN_IF_POSSIBLE)).thenReturn(connection);
        QueryExecutor updateExecutor = mock(QueryExecutor.class);

        UpdateMessageProcessor processor = new UpdateMessageProcessor(null, null, null, null, null);
        MuleEvent event = mock(MuleEvent.class);
        MuleMessage muleMessage = mock(MuleMessage.class);
View Full Code Here

Examples of org.mule.module.db.internal.domain.connection.DbConnectionFactory

    @Test
    public void resolvesCustomDbTypes() throws Exception
    {
        GenericDbConfig dbConfig = muleContext.getRegistry().lookupObject("dbConfig");
        DbTypeManager dbTypeManager = dbConfig.getDbTypeManager();
        DbConnectionFactory connectionFactory = dbConfig.getConnectionFactory();
        DbConnection connection = connectionFactory.createConnection(TransactionalAction.NOT_SUPPORTED);

        try
        {
            assertResolvesType(connection, dbTypeManager, CUSTOM_TYPE_NAME1, CUSTOM_TYPE_ID1);
            assertResolvesType(connection, dbTypeManager, CUSTOM_TYPE_NAME2, CUSTOM_TYPE_ID2);
        }
        finally
        {
            connectionFactory.releaseConnection(connection);
        }
    }
View Full Code Here

Examples of org.rhq.cassandra.schema.DBConnectionFactory

                }

                final String dbPassword = clearTextDbPassword;
                final String dbUrl = serverProperties.get(ServerProperties.PROP_DATABASE_CONNECTION_URL);
                final String dbUsername = serverProperties.get(ServerProperties.PROP_DATABASE_USERNAME);
                DBConnectionFactory connectionFactory = new DBConnectionFactory() {
                    @Override
                    public Connection newConnection() throws SQLException {
                        return DbUtil.getConnection(dbUrl, dbUsername, dbPassword);
                    }
                };
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.