FileDocCategorySizeDatePackage
ManagedConnectionFactory.javaAPI DocGlassfish v2 API36179Fri May 04 22:36:04 BST 2007com.sun.gjc.spi

ManagedConnectionFactory

public abstract class ManagedConnectionFactory extends Object implements javax.resource.spi.ValidatingManagedConnectionFactory, javax.resource.spi.ManagedConnectionFactory, Serializable
ManagedConnectionFactory implementation for Generic JDBC Connector. This class is extended by the DataSource specific ManagedConnection factories and the ManagedConnectionFactory for the DriverManager.
author
Evani Sai Surya Kiran, Aditya Gore
version
1.0, 02/08/03

Fields Summary
protected com.sun.gjc.common.DataSourceSpec
spec
protected transient com.sun.gjc.common.DataSourceObjectBuilder
dsObjBuilder
protected PrintWriter
logWriter
protected javax.resource.spi.ResourceAdapter
ra
private static Logger
_logger
protected boolean
statementWrapping
private JdbcObjectsFactory
jdbcObjectsFactory
protected javax.resource.spi.LazyEnlistableConnectionManager
cm_
protected boolean
isLazyCm_
protected static final int
JVM_OPTION_STATEMENT_WRAPPING_ON
protected static final int
JVM_OPTION_STATEMENT_WRAPPING_OFF
protected static final int
JVM_OPTION_STATEMENT_WRAPPING_NOT_SET
private static int
wrapStatement
This wrapStatement flag is used to enable disable wrapping the statement objects. This can be enabled by passing jvm option, com.sun.appserv.jdbc.wrapstatement = true. This can be disabled by removing this option or by passing non true value. By default this will be disabled
Constructors Summary
Methods Summary
protected voidcomputeStatementWrappingStatus()
9.1 has attribute "wrap-statements" which will be overriden when JVM option is specified as "true" or "false" JVM Option will be deprecated in future versions.


        boolean poolProperty = false;
        String statementWrappingString = getStatementWrapping();
        if (statementWrappingString != null)
            poolProperty = Boolean.valueOf(statementWrappingString);

        if (wrapStatement == JVM_OPTION_STATEMENT_WRAPPING_ON ||
                (wrapStatement == JVM_OPTION_STATEMENT_WRAPPING_NOT_SET && poolProperty)) {
            statementWrapping = true;
        } else {
            statementWrapping = false;
        }
    
protected ManagedConnectionconstructManagedConnection(javax.sql.PooledConnection pc, java.sql.Connection sqlCon, javax.resource.spi.security.PasswordCredential passCred, com.sun.gjc.spi.ManagedConnectionFactory mcf)

        return new com.sun.gjc.spi.ManagedConnection(pc, sqlCon, passCred, mcf);
    
public java.lang.ObjectcreateConnectionFactory()
Creates a Connection Factory instance. The ConnectionManager implementation of the resource adapter is used here.

return
Generic JDBC Connector implementation of javax.sql.DataSource

        if (logWriter != null) {
            logWriter.println("In createConnectionFactory()");
        }
        return jdbcObjectsFactory.getDataSourceInstance(this, null);
    
public java.lang.ObjectcreateConnectionFactory(javax.resource.spi.ConnectionManager cxManager)
Creates a Connection Factory instance. The ConnectionManager implementation of the application server is used here.

param
cxManager ConnectionManager passed by the application server
return
Generic JDBC Connector implementation of javax.sql.DataSource

        if (logWriter != null) {
            logWriter.println("In createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)");
        }

        javax.sql.DataSource cf = jdbcObjectsFactory.getDataSourceInstance(this, cxManager);

        if (cxManager instanceof javax.resource.spi.LazyEnlistableConnectionManager) {
            cm_ = (javax.resource.spi.LazyEnlistableConnectionManager) cxManager;
            isLazyCm_ = true;
        }
        return cf;
    
public abstract javax.resource.spi.ManagedConnectioncreateManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
Creates a new physical connection to the underlying EIS resource manager.

param
subject Subject instance passed by the application server
param
cxRequestInfo ConnectionRequestInfo which may be created as a result of the invocation getConnection(user, password) on the DataSource object
return
ManagedConnection object created
throws
ResourceException if there is an error in instantiating the DataSource object used for the creation of the ManagedConnection object
throws
SecurityException if there ino PasswordCredential object satisfying this request
throws
ResourceException if there is an error in allocating the physical connection

public abstract booleanequals(java.lang.Object other)
Check if this ManagedConnectionFactory is equal to another ManagedConnectionFactory.

param
other ManagedConnectionFactory object for checking equality with
return
true if the property sets of both the ManagedConnectionFactory objects are the same false otherwise

public java.lang.StringgetClassName()
Gets the class name of the data source

return
className

        return spec.getDetail(DataSourceSpec.CLASSNAME);
    
public java.lang.StringgetConnectionValidationRequired()
Returns if connection validation is required or not

return
connection validation requirement

        return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
    
public java.lang.ObjectgetDataSource()
Returns the underlying datasource

return
DataSource of jdbc vendor
throws
ResourceException

        if (dsObjBuilder == null) {
            dsObjBuilder = new DataSourceObjectBuilder(spec);
        }
        return dsObjBuilder.constructDataSourceObject();
    
public java.lang.StringgetDataSourceName()
Gets the data source name.

return
dsn
see
setDataSourceName

        return spec.getDetail(DataSourceSpec.DATASOURCENAME);
    
public java.lang.StringgetDatabaseName()
Gets the database name.

return
databaseName
see
setDatabaseName

        return spec.getDetail(DataSourceSpec.DATABASENAME);
    
public java.lang.StringgetDelimiter()
Gets the delimiter.

return
delim
see
setDelimiter

        return spec.getDetail(DataSourceSpec.DELIMITER);
    
public java.lang.StringgetDescription()
Gets the description.

return
desc
see
setDescription

        return spec.getDetail(DataSourceSpec.DESCRIPTION);
    
public java.lang.StringgetDriverProperties()
Gets the driver specific properties.

return
driverProps
see
setDriverProperties

        return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
    
public java.lang.StringgetGuaranteeIsolationLevel()
Returns the transaction isolation level

return
isolation level guarantee

        return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
    
public java.util.SetgetInvalidConnections(java.util.Set connectionSet)
This method returns a set of invalid ManagedConnection objects chosen from a specified set of ManagedConnection objects.

param
connectionSet a set of ManagedConnection objects that need to be validated.
return
a set of invalid ManagedConnection objects.
throws
ResourceException generic exception.

        Iterator iter = connectionSet.iterator();
        Set invalid = new HashSet();
        while (iter.hasNext()) {
            ManagedConnection mc = (ManagedConnection) iter.next();
            try {
                isValid(mc);
            } catch (ResourceException re) {
                invalid.add(mc);
                mc.connectionErrorOccurred(re, null);
                if(_logger.isLoggable(Level.FINE)){
                    _logger.log(Level.FINE, "jdbc.invalid_connection", re);
                }
            }
        }
        return invalid;
    
public java.lang.StringgetJdbc30DataSource()

        return spec.getDetail(DataSourceSpec.JDBC30DATASOURCE);
    
public JdbcObjectsFactorygetJdbcObjectsFactory()

        return jdbcObjectsFactory;
    
public java.io.PrintWritergetLogWriter()
Get the log writer for this ManagedConnectionFactory instance.

return
PrintWriter associated with this ManagedConnectionFactory instance
see
setLogWriter

        return logWriter;
    
public java.lang.StringgetLoginTimeOut()
Gets the login timeout.

return
loginTimeout
see
setLoginTimeOut

        return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
    
public java.lang.StringgetNetworkProtocol()
Gets the network protocol.

return
nwProtocol
see
setNetworkProtocol

        return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
    
public java.lang.StringgetPassword()
Gets the password

return
passwd

        return spec.getDetail(DataSourceSpec.PASSWORD);
    
public java.lang.StringgetPortNumber()
Gets the port number.

return
portNumber
see
setPortNumber

        return spec.getDetail(DataSourceSpec.PORTNUMBER);
    
public javax.resource.spi.ResourceAdaptergetResourceAdapter()
Get the ResourceAdapter for this ManagedConnectionFactory instance.

return
ResourceAdapter associated with this ManagedConnectionFactory instance
see
setResourceAdapter

        if (logWriter != null) {
            logWriter.println("In getResourceAdapter");
        }
        return ra;
    
public java.lang.StringgetRoleName()
Gets the role name.

return
roleName
see
setRoleName

        return spec.getDetail(DataSourceSpec.ROLENAME);
    
public java.lang.StringgetServerName()
Gets the server name.

return
serverName
see
setServerName

        return spec.getDetail(DataSourceSpec.SERVERNAME);
    
public java.lang.StringgetStatementTimeout()
Gets the StatementTimeout value

return
String representing "true" or "false"
see
setStatementTimeout

        return spec.getDetail(DataSourceSpec.STATEMENTTIMEOUT);
    
public java.lang.StringgetStatementWrapping()
Gets the statement wrapping value

return
String representing "true" or "false"
see
setStatementWrapping

        return spec.getDetail(DataSourceSpec.STATEMENTWRAPPING);
    
private static intgetStatementWrappingJVMOption()
Gets the Statement Wrapping JVM Option (available in 8.2)
Which will be deprecated in future versions.

return
int representing the JVM Option value of statement wrapping.


     
        wrapStatement = getStatementWrappingJVMOption();
    
        int result = JVM_OPTION_STATEMENT_WRAPPING_NOT_SET;
        String str = System.getProperty(
                "com.sun.appserv.jdbc.wrapJdbcObjects");
        if ("true".equalsIgnoreCase(str)) {
            result = JVM_OPTION_STATEMENT_WRAPPING_ON;
        } else if ("false".equalsIgnoreCase(str)) {
            result = JVM_OPTION_STATEMENT_WRAPPING_OFF;
        }
        return result;
    
public java.lang.StringgetTransactionIsolation()
Returns the transaction isolation level

return
transaction isolation level

        return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
    
private intgetTransactionIsolationInt(java.lang.String tranIsolation)
Gets the integer equivalent of the string specifying the transaction isolation.

param
tranIsolation string specifying the isolation level
return
tranIsolationInt the java.sql.Connection constant for the string specifying the isolation.

        if (tranIsolation.equalsIgnoreCase("read-uncommitted")) {
            return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
        } else if (tranIsolation.equalsIgnoreCase("read-committed")) {
            return java.sql.Connection.TRANSACTION_READ_COMMITTED;
        } else if (tranIsolation.equalsIgnoreCase("repeatable-read")) {
            return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
        } else if (tranIsolation.equalsIgnoreCase("serializable")) {
            return java.sql.Connection.TRANSACTION_SERIALIZABLE;
        } else {
            throw new ResourceException("Invalid transaction isolation; the transaction "
                    + "isolation level can be empty or any of the following: "
                    + "read-uncommitted, read-committed, repeatable-read, serializable");
        }
    
public java.lang.StringgetUser()
Gets the user name

return
user

        return spec.getDetail(DataSourceSpec.USERNAME);
    
public java.lang.StringgetValidationMethod()
Returns the connection validation method type

return
validation method

        return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
    
public java.lang.StringgetValidationTableName()
Returns the table checked for during validation

return
table

        return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
    
public inthashCode()
Returns the hash code for this ManagedConnectionFactory.

return
hash code for this ManagedConnectionFactory

        if (logWriter != null) {
            logWriter.println("In hashCode");
        }
        return spec.hashCode();
    
protected booleanisEqual(javax.resource.spi.security.PasswordCredential pc, java.lang.String user, java.lang.String password)


        //if equal get direct connection else
        //get connection with user and password.

        String thisUser = (pc == null) ? null : pc.getUserName();
        char[] passwordArray = (pc == null) ? null : pc.getPassword();
        String thisPassword = (passwordArray == null) ? null : new String(passwordArray);

        return (isStringEqual(thisUser, user) && isStringEqual(thisPassword, password));

    
public booleanisStatementWrappingEnabled()
Returns whether statement wrapping is enabled or not.

return
boolean representing statementwrapping status

        return statementWrapping;
    
private booleanisStringEqual(java.lang.String str1, java.lang.String str2)

        return str1 == null ? str2 == null : str1.equals(str2);
    
voidisValid(com.sun.gjc.spi.ManagedConnection mc)
Checks if a ManagedConnection is to be validated or not and validates it or returns.

param
mc ManagedConnection to be validated
throws
ResourceException if the connection is not valid or if validation method is not proper


        if (mc == null || mc.isTransactionInProgress()) {
            return;
        }

        String conVal = spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);

        boolean connectionValidationRequired =
                (conVal == null) ? false : Boolean.valueOf(conVal.toLowerCase());
        if (!connectionValidationRequired) {
            return;
        }


        String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();

        mc.checkIfValid();
        /**
         * The above call checks if the actual physical connection
         * is usable or not.
         */
        java.sql.Connection con = mc.getActualConnection();

        if (validationMethod.equals("auto-commit")) {
            isValidByAutoCommit(con);
        } else if (validationMethod.equals("meta-data")) {
            isValidByMetaData(con);
        } else if (validationMethod.equals("table")) {
            isValidByTableQuery(con, spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME));
        } else {
            throw new ResourceException("The validation method is not proper");
        }
    
protected voidisValidByAutoCommit(java.sql.Connection con)
Checks if a java.sql.Connection is valid or not by checking its auto commit property.

param
con java.sql.Connection to be validated
throws
ResourceException if the connection is not valid

        if (con == null) {
            throw new ResourceException("The connection is not valid as "
                    + "the connection is null");
        }

        try {
            // Notice that using something like
            // dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
            // some drivers like sybase
            // We do not validate connections that are already enlisted
            //in a transaction
            // We cycle autocommit to true and false to by-pass drivers that
            // might cache the call to set autocomitt
            // Also notice that some XA data sources will throw and exception if
            // you try to call setAutoCommit, for them this method is not recommended

            boolean ac = con.getAutoCommit();
            if (ac) {
                con.setAutoCommit(false);
            } else {
                con.rollback(); // prevents uncompleted transaction exceptions
                con.setAutoCommit(true);
            }

            con.setAutoCommit(ac);

        } catch (Exception sqle) {
            _logger.log(Level.INFO, "jdbc.exc_autocommit_validation");
            throw new ResourceException(sqle);
        }
    
protected voidisValidByMetaData(java.sql.Connection con)
Checks if a java.sql.Connection is valid or not by checking its meta data.

param
con java.sql.Connection to be validated
throws
ResourceException if the connection is not valid

        if (con == null) {
            throw new ResourceException("The connection is not valid as "
                    + "the connection is null");
        }

        try {
            con.getMetaData();
        } catch (Exception sqle) {
            _logger.log(Level.INFO, "jdbc.exc_metadata_validation");
            throw new ResourceException(sqle);
        }                                                      
    
protected voidisValidByTableQuery(java.sql.Connection con, java.lang.String tableName)
Checks if a java.sql.Connection is valid or not by querying a table.

param
con java.sql.Connection to be validated
param
tableName table which should be queried
throws
ResourceException if the connection is not valid

        if (con == null) {
            throw new ResourceException("The connection is not valid as "
                    + "the connection is null");
        }

        java.sql.PreparedStatement stmt = null;
        java.sql.ResultSet rs = null;
        try {
            stmt = con.prepareStatement("SELECT COUNT(*) FROM " + tableName);
            rs = stmt.executeQuery();
        } catch (Exception sqle) {
                _logger.log(Level.INFO, "jdbc.exc_table_validation", tableName);
                throw new ResourceException(sqle);
        } finally {
            try {
                if (rs != null) {
                    rs.close();
                }
            } catch (Exception e1) {
            }

            try {
                if (stmt != null) {
                    stmt.close();
                }
            } catch (Exception e2) {
            }
        }
    
public javax.resource.spi.ManagedConnectionmatchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
Returns a matched ManagedConnection from the candidate set of ManagedConnection objects.

param
connectionSet Set of ManagedConnection objects passed by the application server
param
subject passed by the application server for retrieving information required for matching
param
cxRequestInfo ConnectionRequestInfo passed by the application server for retrieving information required for matching
return
ManagedConnection that is the best match satisfying this request
throws
ResourceException if there is an error accessing the Subject parameter or the Set of ManagedConnection objects passed by the application server

        if (logWriter != null) {
            logWriter.println("In matchManagedConnections");
        }

        if (connectionSet == null) {
            return null;
        }



        PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);

        java.util.Iterator iter = connectionSet.iterator();
        com.sun.gjc.spi.ManagedConnection mc = null;

        while (iter.hasNext()) {
            try {
                mc = (com.sun.gjc.spi.ManagedConnection) iter.next();
            } catch (java.util.NoSuchElementException nsee) {
                _logger.log(Level.SEVERE, "jdbc.exc_iter");
                throw new ResourceException(nsee.getMessage());
            }
            if (pc == null && this.equals(mc.getManagedConnectionFactory())) {
                return mc;
            } else if (SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential())) {
                return mc;
            }
        }
        return null;
    
voidresetIsolation(com.sun.gjc.spi.ManagedConnection mc, int tranIsol)
Resets the isolation level for the ManagedConnection passed. If the transaction level is to be guaranteed to be the same as the one present when this ManagedConnection was created, as specified by the ConnectionRequestInfo passed, it sets the transaction isolation level from the ConnectionRequestInfo passed. Else, it sets it to the transaction isolation passed.

param
mc ManagedConnection
param
tranIsol int
throws
ResourceException if the isolation property is invalid or if the isolation cannot be set over the connection


        java.sql.Connection con = mc.getActualConnection();
        if (con == null) {
            return;
        }

        String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
        if (tranIsolation != null && tranIsolation.equals("") == false) {
            String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);

            if (guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
                boolean guarantee = Boolean.valueOf(guaranteeIsolationLevel.toLowerCase());

                if (guarantee) {
                    int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
                    try {
                        if (tranIsolationInt != con.getTransactionIsolation()) {
                            con.setTransactionIsolation(tranIsolationInt);
                        }
                    } catch (java.sql.SQLException sqle) {
                        _logger.log(Level.SEVERE, "jdbc.exc_tx_iso", sqle);
                        throw new ResourceException("The isolation level could not be set: "
                                + sqle.getMessage());
                    }
                } else {
                    try {
                        if (tranIsol != con.getTransactionIsolation()) {
                            con.setTransactionIsolation(tranIsol);
                        }
                    } catch (java.sql.SQLException sqle) {
                        _logger.log(Level.SEVERE, "jdbc.exc_tx_iso", sqle);
                        throw new ResourceException("The isolation level could not be set: "
                                + sqle.getMessage());
                    }
                }
            }
        }
    
public voidsetClassName(java.lang.String className)
Sets the class name of the data source

param
className String

        spec.setDetail(DataSourceSpec.CLASSNAME, className);
    
public voidsetConnectionValidationRequired(java.lang.String conVldReq)
Sets if connection validation is required or not

param
conVldReq String

        spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
    
public voidsetDataSourceName(java.lang.String dsn)
Sets the data source name.

param
dsn String
see
getDataSourceName

        spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
    
public voidsetDatabaseName(java.lang.String databaseName)
Sets the database name.

param
databaseName String
see
getDatabaseName

        spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
    
public voidsetDelimiter(java.lang.String delim)
Sets the delimiter.

param
delim String
see
getDelimiter

        spec.setDetail(DataSourceSpec.DELIMITER, delim);
    
public voidsetDescription(java.lang.String desc)
Sets the description.

param
desc String
see
getDescription

        spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
    
public voidsetDriverProperties(java.lang.String driverProps)
Sets the driver specific properties.

param
driverProps String
see
getDriverProperties

        spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
    
public voidsetGuaranteeIsolationLevel(java.lang.String guaranteeIsolation)
Sets if the transaction isolation level is to be guaranteed

param
guaranteeIsolation String

        spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
    
protected voidsetIsolation(com.sun.gjc.spi.ManagedConnection mc)
Sets the isolation level specified in the ConnectionRequestInfo for the ManagedConnection passed.

param
mc ManagedConnection
throws
ResourceException if the isolation property is invalid or if the isolation cannot be set over the connection


        java.sql.Connection con = mc.getActualConnection();
        if (con == null) {
            return;
        }

        String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
        if (tranIsolation != null && tranIsolation.equals("") == false) {
            int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
            try {
                con.setTransactionIsolation(tranIsolationInt);
                mc.setLastTransactionIsolationLevel(tranIsolationInt);
            } catch (java.sql.SQLException sqle) {
                _logger.log(Level.SEVERE, "jdbc.exc_tx_iso", sqle);
                throw new ResourceException("The transaction isolation could "
                        + "not be set: " + sqle.getMessage());
            }
        }
    
public voidsetJdbc30DataSource(java.lang.String booleanValue)

        spec.setDetail(DataSourceSpec.JDBC30DATASOURCE,booleanValue);
    
public voidsetLogWriter(java.io.PrintWriter out)
Set the log writer for this ManagedConnectionFactory instance.

param
out PrintWriter passed by the application server
see
getLogWriter

        logWriter = out;
    
public voidsetLoginTimeOut(java.lang.String loginTimeOut)
Sets the login timeout.

param
loginTimeOut String
see
getLoginTimeOut

        spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
    
public voidsetNetworkProtocol(java.lang.String nwProtocol)
Sets the network protocol.

param
nwProtocol String
see
getNetworkProtocol

        spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
    
public voidsetPassword(java.lang.String passwd)
Sets the password

param
passwd String

        spec.setDetail(DataSourceSpec.PASSWORD, passwd);
    
public voidsetPortNumber(java.lang.String portNumber)
Sets the port number.

param
portNumber String
see
getPortNumber

        spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
    
public voidsetResourceAdapter(javax.resource.spi.ResourceAdapter ra)
Set the associated ResourceAdapter JavaBean.

param
ra ResourceAdapter associated with this ManagedConnectionFactory instance
see
getResourceAdapter

        this.ra = ra;
    
public voidsetRoleName(java.lang.String roleName)
Sets the role name.

param
roleName String
see
getRoleName

        spec.setDetail(DataSourceSpec.ROLENAME, roleName);
    
public voidsetServerName(java.lang.String serverName)
Sets the server name.

param
serverName String
see
getServerName

        spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
    
public voidsetStatementTimeout(java.lang.String timeout)
Set StatementTimeout value

param
timeout String
see
getStatementTimeout

        spec.setDetail(DataSourceSpec.STATEMENTTIMEOUT, timeout);
    
public voidsetStatementWrapping(java.lang.String wrapping)
Set Statement Wrapping value

param
wrapping String
see
getStatementWrapping

        spec.setDetail(DataSourceSpec.STATEMENTWRAPPING, wrapping);
        computeStatementWrappingStatus();
    
public voidsetTransactionIsolation(java.lang.String trnIsolation)
Sets the transaction isolation level

param
trnIsolation String

        spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
    
public voidsetUser(java.lang.String user)
Sets the user name

param
user String

        spec.setDetail(DataSourceSpec.USERNAME, user);
    
public voidsetValidationMethod(java.lang.String validationMethod)
Sets the validation method required

param
validationMethod String

        spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
    
public voidsetValidationTableName(java.lang.String table)
Sets the table checked for during validation

param
table String

        spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
    
protected voidvalidateAndSetIsolation(com.sun.gjc.spi.ManagedConnection mc)
Common operation performed by all the child MCFs before returning a created mc

        isValid(mc);
        setIsolation(mc);