Package org.castor.cpa.test.framework.xml

Examples of org.castor.cpa.test.framework.xml.DatabaseChoice


            throw new CPAConfigException("No engine specified "
                    + "in database config '" + db + "'.");
        }
        String engine = database.getEngine().toString();
       
        DatabaseChoice choice = database.getDatabaseChoice();
        if (choice == null) {
            throw new CPAConfigException("Neither driver, datasource nor jndi specified "
                    + "in database config '" + db + "'.");
        }
       
        if (choice.getDriver() != null) {
            return JDOConfFactory.createDatabase(name, engine,
                    createDriver(db, choice.getDriver()), mappings);
        } else if (choice.getDataSource() != null) {
            return JDOConfFactory.createDatabase(name, engine,
                    createDataSource(db, choice.getDataSource()), mappings);
        } else if (choice.getJndi() != null) {
            return JDOConfFactory.createDatabase(name, engine,
                    createJNDI(db, choice.getJndi()), mappings);
        } else {
            throw new CPAConfigException("Neither driver, datasource nor jndi specified "
                    + "in database config '" + db + "'.");
        }
    }
View Full Code Here

TOP

Related Classes of org.castor.cpa.test.framework.xml.DatabaseChoice

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.