Package com.volantis.mcs.repository.jdbc

Examples of com.volantis.mcs.repository.jdbc.JDBCDriverConfiguration


     * @throws RepositoryException
     */
    public static DataSource createJDBCDriverDataSource(Map properties)
            throws RepositoryException {

        JDBCDriverConfiguration configuration =
                factory.createJDBCDriverConfiguration();

        // If we find parameters then we place these parameters as key/value
        // pairs in the properties file. The idea is to provide a mechanism
        // for supplying JDBC configuration values using this map.
        // For example, if the key/value is 'user'/'volantis' then this value
        // would be used instead of any value for 'user' found in the config
        // file.
        final Properties driverProperties = new Properties();
        driverProperties.putAll((Map) properties.get(PARAMETERS_PROPERTY));
        configuration.setDriverProperties(driverProperties);

        final String driverClassName = (String) properties.get(
                DRIVER_CLASS_PROPERTY);
        configuration.setDriverClassName(driverClassName);

        final String url = (String) properties.get(DATABASE_URL_PROPERTY);
        configuration.setDriverSpecificDatabaseURL(url);

        MCSConnectionPoolConfiguration connectionPoolConfiguration =
                getConnectionPoolConfiguration(factory, properties);
        configuration.setConnectionPoolConfiguration(
                connectionPoolConfiguration);

        return factory.createJDBCDriverDataSource(configuration);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.repository.jdbc.JDBCDriverConfiguration

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.