org.dbforms.conprovider
Class ConnectionFactory

java.lang.Object
  extended by org.dbforms.conprovider.ConnectionFactory

public class ConnectionFactory
extends Object

ConnectionFactory class.
Provides SQL Connection objects using the underlying ConnectionProvider instance.

Author:
Luca Fossato

Method Summary
 Connection getConnection()
          Get a connection object from the underlying ConnectionProvider object.
 Connection getConnection(int isolationLevel)
          Get a "transactional" JDBC connection from the underlying default ConnectionProvider.
static ConnectionFactory instance()
          Get the unique instance of ConnectionFactory class.
 void setProvider(ConnectionProviderPrefs prefs)
          Set the ConnectionProvider object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static ConnectionFactory instance()
Get the unique instance of ConnectionFactory class.

Returns:
the instance of ConnectionFactory class

getConnection

public Connection getConnection()
                         throws SQLException
Get a connection object from the underlying ConnectionProvider object.

Returns:
the connection object from the underlying ConnectionProvider object
Throws:
SQLException - if any error occurs

getConnection

public Connection getConnection(int isolationLevel)
                         throws SQLException
Get a "transactional" JDBC connection from the underlying default ConnectionProvider.

Parameters:
isolationLevel - the isolation level to set the connection to
Returns:
the new "transactional" connection object from the underlying default ConnectionProvider
Throws:
SQLException - if any error occurs

setProvider

public void setProvider(ConnectionProviderPrefs prefs)
                 throws Exception
Set the ConnectionProvider object

Parameters:
prefs - the connection provider preferences object
Throws:
Exception - if any error occurs


Copyright © 2002-2006 DbForms. All Rights Reserved.