Package org.exolab.jms.config

Examples of org.exolab.jms.config.RdbmsDatabaseConfiguration


     */
    public RDBMSAdapter(DatabaseConfiguration dbConfig, String driver, String url,
                 String userName, String password)
            throws PersistenceException {

        RdbmsDatabaseConfiguration config =
                dbConfig.getRdbmsDatabaseConfiguration();

        // create the connection manager, and configure it
        _connectionManager = getConnectionManager(config.getClazz());
        _connectionManager.setUser(userName);
        _connectionManager.setPassword(password);
        _connectionManager.setDriver(driver);
        _connectionManager.setURL(url);
        _connectionManager.setMaxActive(config.getMaxActive());
        _connectionManager.setMaxIdle(config.getMaxIdle());
        _connectionManager.setMinIdleTime(config.getMinIdleTime());
        _connectionManager.setEvictionInterval(config.getEvictionInterval());
        _connectionManager.setTestQuery(config.getTestQuery());
        _connectionManager.setTestBeforeUse(config.getTestBeforeUse());

        // initialisze the connection manager
        _connectionManager.init();

        Connection connection = null;
View Full Code Here


     * @throws PersistenceException if the adapter cant be created
     */
    private PersistenceAdapter createAdapter(
            DatabaseConfiguration dbConfig) throws PersistenceException {
        PersistenceAdapter adapter = null;
        RdbmsDatabaseConfiguration
                config = dbConfig.getRdbmsDatabaseConfiguration();

        _log.info("Creating RdbmsAdapter for "
                + config.getDriver());
        adapter = new RDBMSAdapter(dbConfig, config.getDriver(),
                config.getUrl(),
                config.getUser(),
                config.getPassword());

        return adapter;
    }
View Full Code Here

     *
     * @param config the configuration to use
     * @throws PersistenceException for any error
     */
    private void init(Configuration config) throws PersistenceException {
        RdbmsDatabaseConfiguration rdbms =
                config.getDatabaseConfiguration()
                .getRdbmsDatabaseConfiguration();
        if (rdbms == null) {
            throw new PersistenceException(
                    "Configuration not configured to use an RDBMS");
        }
        _connections = new DBCPConnectionManager();
        _connections.setDriver(rdbms.getDriver());
        _connections.setURL(rdbms.getUrl());
        _connections.setUser(rdbms.getUser());
        _connections.setPassword(rdbms.getPassword());
        _connections.init();
        _tool = new RDBMSTool(_connections.getConnection());
    }
View Full Code Here

     *
     * @param config the configuration
     * @throws PersistenceException for any error
     */
    public RDBMSTool(Configuration config) throws PersistenceException {
        RdbmsDatabaseConfiguration rdbms =
                config.getDatabaseConfiguration()
                .getRdbmsDatabaseConfiguration();
        if (rdbms == null) {
            throw new PersistenceException(
                    "Configuration not configured to use an RDBMS");
        }
        Connection connection = null;
        try {
            Class.forName(rdbms.getDriver());
            connection = DriverManager.getConnection(rdbms.getUrl(),
                                                      rdbms.getUser(),
                                                      rdbms.getPassword());
        } catch (SQLException exception) {
            throw new PersistenceException(exception);
        } catch (ClassNotFoundException exception) {
            throw new PersistenceException(exception);
        }
View Full Code Here

TOP

Related Classes of org.exolab.jms.config.RdbmsDatabaseConfiguration

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.