net.esper.eql.db
Class DatabaseDMConnFactory

java.lang.Object
  extended by net.esper.eql.db.DatabaseDMConnFactory
All Implemented Interfaces:
DatabaseConnectionFactory

public class DatabaseDMConnFactory
extends Object
implements DatabaseConnectionFactory

Database connection factory using DriverManager to obtain connections.


Constructor Summary
DatabaseDMConnFactory(ConfigurationDBRef.DriverManagerConnection driverConfig, ConfigurationDBRef.ConnectionSettings connectionSettings)
          Ctor.
 
Method Summary
 Connection getConnection()
          Creates a new database connection.
protected static void setConnectionOptions(Connection connection, ConfigurationDBRef.ConnectionSettings connectionSettings)
          Method to set connection-level configuration settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseDMConnFactory

public DatabaseDMConnFactory(ConfigurationDBRef.DriverManagerConnection driverConfig,
                             ConfigurationDBRef.ConnectionSettings connectionSettings)
                      throws DatabaseConfigException
Ctor.

Parameters:
driverConfig - is the driver manager configuration
connectionSettings - are connection-level settings
Throws:
DatabaseConfigException - thrown if the driver class cannot be loaded
Method Detail

getConnection

public Connection getConnection()
                         throws DatabaseConfigException
Description copied from interface: DatabaseConnectionFactory
Creates a new database connection.

Specified by:
getConnection in interface DatabaseConnectionFactory
Returns:
new connection
Throws:
DatabaseConfigException - throws to indicate a problem getting a new connection

setConnectionOptions

protected static void setConnectionOptions(Connection connection,
                                           ConfigurationDBRef.ConnectionSettings connectionSettings)
                                    throws DatabaseConfigException
Method to set connection-level configuration settings.

Parameters:
connection - is the connection to set on
connectionSettings - are the settings to apply
Throws:
DatabaseConfigException - is thrown if an SQLException is thrown

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com