Package org.exolab.jms.tools.db

Examples of org.exolab.jms.tools.db.RDBMSTool


        Database schema = SchemaHelper.getSchema();
        try {
            if (_connection.getAutoCommit()) {
                _connection.setAutoCommit(false);
            }
            _tool = new RDBMSTool(_connection);
        } catch (SQLException exception) {
            throw new PersistenceException(exception.getMessage());
        }

        try {
View Full Code Here


        Database schema = SchemaHelper.getSchema();
        try {
            if (_connection.getAutoCommit()) {
                _connection.setAutoCommit(false);
            }
            _tool = new RDBMSTool(_connection);
        } catch (SQLException exception) {
            throw new PersistenceException(exception.getMessage());
        }

        try {
View Full Code Here

     * @throws PersistenceException for any persistence error
     */
    private void init(Configuration config, boolean delete)
            throws PersistenceException {
        // init master tables
        RDBMSTool tool = new RDBMSTool(config);
        Database schema = SchemaHelper.getSchema();

        try {
            if (tool.hasTables(schema.getTable())) {
                if (delete) {
                    tool.delete(schema);
                } else {
                    throw new PersistenceException(
                            "Cannot import data: master database already exists "
                            + "but delete not specified");
                }
            } else {
                tool.create(schema);
            }
        } finally {
            tool.close();
        }
    }
View Full Code Here

        // 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.
        new Exporter(config, DB_NAME, false);
        assertTrue(tool.hasTables(schema.getTable()));
    }
View Full Code Here

        // 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
        try {
            new Exporter(config, DB_NAME, false);
            fail("Expected Exporter construction to fail, as tables exist");
View Full Code Here

    public void testImporterCreateTables() throws Exception {
        // load the configuration for the target master database 'migrated'
        Configuration config = read("/openjmstest_migrated.xml");

        // ensure the tables don't exist
        RDBMSTool tool = new RDBMSTool(config);
        Database schema = SchemaHelper.getSchema();
        tool.drop(schema);
        assertFalse(tool.hasTables(schema.getTable()));

        // Create the importer, and verify it has created the tables.
        new Importer(config, DB_NAME, false);
        assertTrue(tool.hasTables(schema.getTable()));
    }
View Full Code Here

    public void testImporterDelete() throws Exception {
        // load the configuration for the target master database 'migrated'
        Configuration config = read("/openjmstest_migrated.xml");

        // create the target database.
        RDBMSTool tool = new RDBMSTool(config);
        Database schema = SchemaHelper.getSchema();
        tool.drop(schema);
        tool.create(schema);
        tool.close();

        // Create the importer
        try {
            new Importer(config, DB_NAME, false);
            fail("Expected Importer construction to fail, as tables exist");
View Full Code Here

TOP

Related Classes of org.exolab.jms.tools.db.RDBMSTool

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.