Sun Adapter for DB2 Universal Database

com.stc.connector.db2adapter.base
Class AgentFactoryImpl

java.lang.Object
  extended by com.stc.connector.db2adapter.base.AgentFactoryImpl
All Implemented Interfaces:
com.stc.connector.db.AgentFactory

public class AgentFactoryImpl
extends java.lang.Object
implements com.stc.connector.db.AgentFactory

Statement agent factory

Version:
$Revision: 1.6 $
Author:
$Author: afung $

Constructor Summary
AgentFactoryImpl(com.stc.connector.db.Session session)
          Creates a new AgentFactory.
 
Method Summary
 com.stc.connector.appconn.db.StatementAgent getInstance(java.lang.Class clsAgent)
          Gets a statement agent instance.
 com.stc.connector.appconn.db.StatementAgent getInstance(java.lang.Class clsAgent, int iScroll, int iConcur)
          Gets a StatementAgent instance with the specified resultset and concurrency types.
 com.stc.connector.appconn.db.StatementAgent lookup(java.lang.String sName)
          Lookups a StatementAgent instance using its class name.
 void release()
          Releases agent factory resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentFactoryImpl

public AgentFactoryImpl(com.stc.connector.db.Session session)
Creates a new AgentFactory.

Parameters:
session - a Session instance used for creating StatementAgent instance.
Method Detail

lookup

public com.stc.connector.appconn.db.StatementAgent lookup(java.lang.String sName)
Lookups a StatementAgent instance using its class name.

Specified by:
lookup in interface com.stc.connector.db.AgentFactory
Parameters:
sName - a StatementAgent name.
Returns:
a StatementAgent instance.

release

public void release()
Releases agent factory resources.

Specified by:
release in interface com.stc.connector.db.AgentFactory

getInstance

public com.stc.connector.appconn.db.StatementAgent getInstance(java.lang.Class clsAgent)
                                                        throws java.lang.Exception
Gets a statement agent instance.

Specified by:
getInstance in interface com.stc.connector.db.AgentFactory
Parameters:
clsAgent - class of StatementAgent
Returns:
a StatementAgent instance
Throws:
java.lang.Exception - any exception related to instance creation

getInstance

public com.stc.connector.appconn.db.StatementAgent getInstance(java.lang.Class clsAgent,
                                                               int iScroll,
                                                               int iConcur)
                                                        throws java.lang.Exception
Gets a StatementAgent instance with the specified resultset and concurrency types.

Specified by:
getInstance in interface com.stc.connector.db.AgentFactory
Parameters:
clsAgent - class of StatementAgent
iScroll - resultset type; TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
iConcur - concurrency type; CONCUR_READ_ONLY, CONCUR_UPDATABLE
Returns:
a StatementAgent instance
Throws:
java.lang.Exception - any exception related to instance creation

Sun Adapter for DB2 Universal Database