Examples of EmbeddedDataSource


Examples of org.apache.derby.jdbc.EmbeddedDataSource

        // Setup the Derby datasource.
        System.setProperty("derby.system.home", getDataDirectoryFile().getCanonicalPath());
        System.setProperty("derby.storage.fileSyncTransactionLog", "true");
        System.setProperty("derby.storage.pageCacheSize", "100");

        final EmbeddedDataSource ds = new EmbeddedDataSource();
        ds.setDatabaseName("derbydb");
        ds.setCreateDatabase("create");
        return ds;
    }
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

            System.exit(1);
        } else {
            try {
                Connection connection;
                if (dbPath != null) {
                    EmbeddedDataSource dataSource = new EmbeddedDataSource();
                    dataSource.setDatabaseName(dbPath);
                    connection = dataSource.getConnection();

                } else {
                    Configuration config = ConfigurationReader.read(configPath);
                    DatabaseService dbService = new DatabaseService(config);
                    dbService.start();
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

   
    @Override
    public Connector createConnector() throws Exception
    {
        JdbcConnector c = new JdbcConnector(muleContext);
        EmbeddedDataSource embeddedDS = new EmbeddedDataSource();
        embeddedDS.setDatabaseName(DATABASE_NAME);
        c.setName("JdbcConnector");
        c.setDataSource(embeddedDS);
        c.setPollingFrequency(1000);
        return c;
    }
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

        }
        if (database == null) {
            throw new IllegalArgumentException("Argument 'database' is null");
        }
        _database = new DatabaseService(config);
        _dataSource = new EmbeddedDataSource();
        _dataSource.setDatabaseName(database);
        _dataSource.setCreateDatabase("create");
        init(config, delete);
    }
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

     */
    public static final String SCHEMA
            = "/org/exolab/jms/tools/migration/schema.xml";

    public static EmbeddedDataSource getDataSource(String name) {
        EmbeddedDataSource result = new EmbeddedDataSource();
        result.setDatabaseName(name);
        result.setCreateDatabase("create");
        return result;
    }
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

    public void testExporterCreateTables() throws Exception {
        // load the configuration for the master database
        Configuration config = read("/openjmstest.xml");

        // ensure the tables don't exist
        EmbeddedDataSource ds = MigrationHelper.getDataSource(DB_NAME);
        RDBMSTool tool = new RDBMSTool(ds.getConnection());
        Database schema = MigrationHelper.getSchema();
        tool.drop(schema);
        assertFalse(tool.hasTables(schema.getTable()));

        // Create the exporter, and verify it has created the tables.
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

    public void testExporterDelete() throws Exception {
        // load the configuration for the master database
        Configuration config = read("/openjmstest.xml");

        // create the target database.
        EmbeddedDataSource ds = MigrationHelper.getDataSource(DB_NAME);
        RDBMSTool tool = new RDBMSTool(ds.getConnection());
        Database schema = MigrationHelper.getSchema();
        tool.drop(schema);
        tool.create(schema);

        // Create the exporter
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

    public static void testDSRequestAuthentication() throws SQLException {

        if (usingDerbyNetClient())
            return;
       
        EmbeddedDataSource ds = new EmbeddedDataSource();

        // DataSource - EMPTY
        dsConnectionRequests(new String[] { 
             "XJ004","XJ004","XJ004","XJ004",
             "XJ004","XJ004","XJ004","XJ004","XJ004"}, ds);
        // DataSource - connectionAttributes=databaseName=wombat");
        ds.setConnectionAttributes("databaseName=" + dbName);
        dsConnectionRequests(new String[] { 
            "XJ004","XJ004","XJ004","XJ004",
            "XJ004","XJ004","XJ004","XJ004","XJ004"}, ds);
        ds.setConnectionAttributes(null);

        // DataSource - attributesAsPassword=true");
        ds.setAttributesAsPassword(true);
        dsConnectionRequests(new String[] { 
            "XJ004","XJ004","XJ004","XJ028",
            "XJ028","XJ004","XJ004","XJ004","XJ004"}, ds);
        ds.setAttributesAsPassword(false);

        // DataSource - attributesAsPassword=true,
        // connectionAttributes=databaseName=kangaroo");
        ds.setAttributesAsPassword(true);
        ds.setConnectionAttributes("databaseName=kangaroo");
        dsConnectionRequests(new String[] { 
            "XJ004","XJ004","XJ004","XJ028",
            "XJ028","XJ004","XJ004","XJ004","XJ004"}, ds);
        ds.setAttributesAsPassword(false);
        ds.setConnectionAttributes(null);

        // Enable Authentication;

        setDatabaseProperty("derby.user.fred", "wilma");
        setDatabaseProperty("derby.user.APP", "APP");
        setDatabaseProperty("derby.authentication.provider", "BUILTIN");
        setDatabaseProperty("derby.connection.requireAuthentication", "true");
       
        ds.setShutdownDatabase("shutdown");
        try {
            ds.getConnection();
        } catch (SQLException sqle) {
            assertSQLState("XJ015", sqle);
        }

        ds.setDatabaseName(null);
        ds.setShutdownDatabase(null);

        // "AUTHENTICATION NOW ENABLED");

        // DataSource - attributesAsPassword=true
        ds.setAttributesAsPassword(true);
        dsConnectionRequests(new String[] { 
            "XJ004","XJ004","XJ004","XJ028",
            "XJ028","XJ004","XJ004","XJ004","XJ004"}, ds);
        ds.setAttributesAsPassword(false);

        // ensure the DS property password is not treated as a set of
        // attributes.
        // DataSource - attributesAsPassword=true, user=fred,
        //     password=databaseName=wombat;password=wilma
        ds.setAttributesAsPassword(true);
        ds.setUser("fred");
        ds.setPassword("databaseName=" + dbName + ";password=wilma");
        dsConnectionRequests(new String[] { 
            "XJ004","XJ004","XJ004","XJ028",
            "XJ028","XJ004","XJ004","XJ004","XJ004"}, ds);
        ds.setAttributesAsPassword(false);
        ds.setUser(null);
        ds.setPassword(null);
        ds = null;

        // now with ConnectionPoolDataSource
        EmbeddedConnectionPoolDataSource cpds = new EmbeddedConnectionPoolDataSource();
        // ConnectionPoolDataSource - EMPTY
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

        System.setProperty("derby.storage.fileSyncTransactionLog", "true");

        // load the Embedded driver to initialize the home
        new org.apache.derby.jdbc.EmbeddedDriver();

        EmbeddedDataSource datasource = new EmbeddedDataSource();
        datasource.setDatabaseName("SystemDatabase");
        datasource.setCreateDatabase("create");
        try {
            Connection c = datasource.getConnection();
            c.close();
        } catch (SQLException e) {
            while (e.getNextException() != null) {
                e.printStackTrace();
                e = e.getNextException();
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDataSource

public class JDBCMessagePriorityTest extends MessagePriorityTest {

    @Override
    protected PersistenceAdapter createPersistenceAdapter(boolean delete) throws Exception {
        JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
        EmbeddedDataSource dataSource = new EmbeddedDataSource();
        dataSource.setDatabaseName("derbyDb");
        dataSource.setCreateDatabase("create");
        jdbc.setDataSource(dataSource);
        jdbc.deleteAllMessages();
        return jdbc;
    }
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.