Package org.apache.tuscany.das.rdb.config

Examples of org.apache.tuscany.das.rdb.config.ConnectionInfo


        table.setCreate(create);

    }

    public void addConnectionInfo(String dataSourceName, boolean managedtx) {
        ConnectionInfo info = ConfigFactory.INSTANCE.createConnectionInfo();
        info.setDataSource(dataSourceName);
        info.setManagedtx(managedtx);
        config.setConnectionInfo(info);
    }
View Full Code Here


    public void testConnectionInfo() throws Exception {
        ConfigHelper helper = new ConfigHelper();
        helper.addConnectionInfo("jdbc/adatasource");

        Config config = helper.getConfig();
        ConnectionInfo info = config.getConnectionInfo();
        assertEquals(info.getDataSource(), "jdbc/adatasource");
        assertEquals(info.isManagedtx(), true);
    }
View Full Code Here

    public void testConnectionInfo2() throws Exception {
        ConfigHelper helper = new ConfigHelper();
        helper.addConnectionInfo("jdbc/adatasource", false);

        Config config = helper.getConfig();
        ConnectionInfo info = config.getConnectionInfo();
        assertEquals(info.getDataSource(), "jdbc/adatasource");
        assertEquals(info.isManagedtx(), false);
    }
View Full Code Here

    public void testConnectionInfo() throws Exception {
        ConfigHelper helper = new ConfigHelper();
        helper.addConnectionInfo("jdbc/adatasource");

        Config config = helper.getConfig();
        ConnectionInfo info = config.getConnectionInfo();
        assertEquals(info.getDataSource(), "jdbc/adatasource");
        assertEquals(info.isManagedtx(), true);
    }
View Full Code Here

    public void testConnectionInfo2() throws Exception {
        ConfigHelper helper = new ConfigHelper();
        helper.addConnectionInfo("jdbc/adatasource", false);

        Config config = helper.getConfig();
        ConnectionInfo info = config.getConnectionInfo();
        assertEquals(info.getDataSource(), "jdbc/adatasource");
        assertEquals(info.isManagedtx(), false);
    }
View Full Code Here

    public void testConnectionInfoDriverManager() throws Exception {
        ConfigHelper helper = new ConfigHelper();
        helper.addConnectionInfo("org.apache.derby.jdbc.EmbeddedDriver","jdbc:derby:target/dastest", "user", "password", 600);

        Config config = helper.getConfig();
        ConnectionInfo info = config.getConnectionInfo();
        assertNull(info.getDataSource());
        assertEquals(info.getConnectionProperties().getDriverClass(), "org.apache.derby.jdbc.EmbeddedDriver");
        assertEquals(info.getConnectionProperties().getDatabaseURL(), "jdbc:derby:target/dastest");
        assertEquals(info.getConnectionProperties().getUserName(), "user");
        assertEquals(info.getConnectionProperties().getPassword(), "password");
        assertEquals(info.getConnectionProperties().getLoginTimeout(), 600);
   
View Full Code Here

        if(config.getConnectionInfo().getDataSource() != null && config.getConnectionInfo().getConnectionProperties() != null){
            throw new RuntimeException("Use either dataSource or ConnectionProperties. Can't use both !");
        }

        ConnectionInfo connectionInfo = configWrapper.getConfig().getConnectionInfo();
        if(config.getConnectionInfo().getConnectionProperties() != null){
            initializeDriverManagerConnection(connectionInfo);
        }else{
            initializeDatasourceConnection(connectionInfo);
        }
View Full Code Here

    }

    //JIRA-948 support for driver manager connection
    public void addConnectionInfo(String dataSourceName, boolean managedtx){
        ConnectionInfo info = ConfigFactory.INSTANCE.createConnectionInfo();
        info.setDataSource(dataSourceName);
        info.setManagedtx(managedtx);

        config.setConnectionInfo(info);
    }
View Full Code Here

        config.setConnectionInfo(info);
    }
   
    public void addConnectionInfo(String driverClass, String connectionURL, String user, String password, int loginTimeout) {
        ConnectionInfo info = ConfigFactory.INSTANCE.createConnectionInfo();
       
        ConnectionProperties connectionProperties = ConfigFactory.INSTANCE.createConnectionProperties();
        connectionProperties.setDriverClass(driverClass);
        connectionProperties.setDatabaseURL(connectionURL);
        connectionProperties.setUserName(user);
        connectionProperties.setPassword(password);
        connectionProperties.setLoginTimeout(loginTimeout);           

        info.setConnectionProperties(connectionProperties);
        config.setConnectionInfo(info);
    }
View Full Code Here

    }

    //JIRA-948 support for driver manager connection
    public void addConnectionInfo(String dataSourceName, boolean managedtx){
        ConnectionInfo info = ConfigFactory.INSTANCE.createConnectionInfo();
        info.setDataSource(dataSourceName);
        info.setManagedtx(managedtx);

        config.setConnectionInfo(info);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.das.rdb.config.ConnectionInfo

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.