sqlg2.db
Class LocalConnectionFactory

java.lang.Object
  extended by sqlg2.db.LocalConnectionFactory
All Implemented Interfaces:
java.rmi.Remote, IConnectionFactory

public final class LocalConnectionFactory
extends java.lang.Object
implements IConnectionFactory

IConnectionFactory implementation for local connection.


Field Summary
static long ACTIVITY_CHECK_INTERVAL
          Client activity check interval.
static SqlTrace DEFAULT_TRACE
           
 
Fields inherited from interface sqlg2.db.IConnectionFactory
AUTH_BAD_APP, AUTH_BAD_PASS, AUTH_BAD_USER, AUTH_FAILED, DRIVER_NOT_FOUND
 
Constructor Summary
LocalConnectionFactory(AuthenticationHelper auth, DBSpecific specific)
          Constructor.
 
Method Summary
 SessionInfo[] getActiveSessions()
          Returns active sessions descriptors
static LocalConnectionFactory newLocalOracleInstance(java.lang.String driver, java.lang.String url)
           
 IDBInterface openConnection(IDBInterface oldConnection, java.lang.String password)
          This method is rarely used directly, it is intended for use by IDBInterface.migrateTo(IConnectionFactory).
 IDBInterface openConnection(java.lang.String user, java.lang.String password)
          Connecting to DB using external authentication (server must support that) - connection properties are taken from AuthenticationHelper.
 void setSqlTrace(SqlTrace trace)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTIVITY_CHECK_INTERVAL

public static final long ACTIVITY_CHECK_INTERVAL
Client activity check interval. If client does not call any method between checks its session is closed.

See Also:
Constant Field Values

DEFAULT_TRACE

public static final SqlTrace DEFAULT_TRACE
Constructor Detail

LocalConnectionFactory

public LocalConnectionFactory(AuthenticationHelper auth,
                              DBSpecific specific)
Constructor.

See Also:
ConnectionFactory
Method Detail

newLocalOracleInstance

public static LocalConnectionFactory newLocalOracleInstance(java.lang.String driver,
                                                            java.lang.String url)

openConnection

public IDBInterface openConnection(java.lang.String user,
                                   java.lang.String password)
                            throws java.rmi.RemoteException,
                                   java.sql.SQLException
Description copied from interface: IConnectionFactory
Connecting to DB using external authentication (server must support that) - connection properties are taken from AuthenticationHelper. Given parameters are passed to AuthenticationHelper.authenticate(java.sql.Connection,String,String).

Specified by:
openConnection in interface IConnectionFactory
Parameters:
user - external user
password - external password
Returns:
DB connection
Throws:
java.rmi.RemoteException
java.sql.SQLException

openConnection

public IDBInterface openConnection(IDBInterface oldConnection,
                                   java.lang.String password)
                            throws java.rmi.RemoteException,
                                   java.sql.SQLException
Description copied from interface: IConnectionFactory
This method is rarely used directly, it is intended for use by IDBInterface.migrateTo(IConnectionFactory).

Specified by:
openConnection in interface IConnectionFactory
Parameters:
oldConnection - already opened DB connection
password - user password
Returns:
new DB connection
Throws:
java.rmi.RemoteException
java.sql.SQLException

getActiveSessions

public SessionInfo[] getActiveSessions()
Description copied from interface: IConnectionFactory
Returns active sessions descriptors

Specified by:
getActiveSessions in interface IConnectionFactory

setSqlTrace

public void setSqlTrace(SqlTrace trace)