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

JdbcObjectsFactory

public abstract class JdbcObjectsFactory extends Object implements Serializable
Factory to create JDBC objects

Fields Summary
private static Logger
_logger
Constructors Summary
Methods Summary
public abstract com.sun.gjc.spi.base.ConnectionHoldergetConnection(java.sql.Connection conObject, com.sun.gjc.spi.ManagedConnection mcObject, javax.resource.spi.ConnectionRequestInfo criObject, boolean statementWrapping)
To get an instance of ConnectionHolder.
Will return a ConnectionHolder with or without wrapper

param
conObject Connection
param
mcObject ManagedConnection
param
criObject Connection Request Info
param
statementWrapping Whether to wrap statement objects or not.
return
ConnectionHolder

public abstract javax.sql.DataSourcegetDataSourceInstance(com.sun.gjc.spi.ManagedConnectionFactory mcfObject, javax.resource.spi.ConnectionManager cmObject)
Returns a DataSource instance.

param
mcfObject Managed Connection Factory
param
cmObject Connection Manager
return
DataSource

public static com.sun.gjc.spi.JdbcObjectsFactorygetInstance()
Returns JDBC Objet Factory for JDBC 3.0 or JDBC 4.0 depending upon the jdbc version
available in JDK.

return
JdbcObjectsFactory

        _logger = LogDomains.getLogger(LogDomains.RSR_LOGGER);
    
        boolean jdbc40 = DataSourceObjectBuilder.isJDBC40();
        JdbcObjectsFactory factory = null;
        try {
            if (jdbc40) {
                factory = (JdbcObjectsFactory) Class.forName("com.sun.gjc.spi.jdbc40.Jdbc40ObjectsFactory").newInstance();
            } else {
                factory = (JdbcObjectsFactory) Class.forName("com.sun.gjc.spi.jdbc30.Jdbc30ObjectsFactory").newInstance();
            }
        } catch (Exception e) {
            _logger.log(Level.WARNING, "jdbc.jdbc_factory_class_load_exception", e);
        }
        return factory;