oracle.sqlj.runtime
Class SqljConnBean

java.lang.Object
  |
  +--oracle.jsp.dbutil.ConnBean
        |
        +--oracle.sqlj.runtime.SqljConnBean

public class SqljConnBean
extends oracle.jsp.dbutil.ConnBean
implements java.io.Serializable

SqljConnBean enhances JSP ConnBean with the "m_contextClass" bean property, the "getContext" method, and the "getDefaultContext" method.

A SqljConnBean instance is associated with at most one JDBC connection and one SQLJ connection context, called the current connection and the current connection context respectively.

See Also:
ConnBean, ConnectionContext, Bean for ConnBean
  • User - user name for connection
  • Password password for connection
  • URL URL for database connection
  • StmtCacheSize Enable and set the statement cache size
  • ExecuteBatch Execute Batch Size for DMLs
  • PreFetch Row prefetch size for the rows returned for queries.
  • ContextClass Set the type for connection context , Serialized Form

  • Fields inherited from class oracle.jsp.dbutil.ConnBean
    m_conn
     
    Constructor Summary
    SqljConnBean()
               
     
    Method Summary
     ConnectionContext getContext()
              Returns a connection context, whose type is determine by the bean property "ContextClass".
     ConnectionContext getContext(boolean autoCommit)
              Returns the same result as getContext, except that the auto-commit staus in the underline JDBC connection is reseted according to the parameter.
     ConnectionContext getContext(java.lang.Class ctxClass)
              Returns a connection context, whose type is determine by the parameter "ctxClass".
     ConnectionContext getContext(java.lang.Class ctxClass, boolean autoCommit)
              Returns the same result as getContext(Class), except that the auto-commit staus in the underline JDBC connection is reseted according to the parameter.
     java.lang.String getContextClass()
              Get the fully qualified name of the underlying connection context class.
     DefaultContext getDefaultContext()
              Returns a connection context of Type DefaultContext.
     DefaultContext getDefaultContext(boolean autoCommit)
              Returns the same result as getDefaultContext, except that the auto-commit staus in the underline JDBC connection is reseted according to the parameter.
     void setContextClass(java.lang.String className)
              Set the fully qualified name of the underlying connection context class.
     
    Methods inherited from class oracle.jsp.dbutil.ConnBean
    close, connect, getConnection, getCursorBean, getExecuteBatch, getPassword, getPreFetch, getStmtCacheSize, getURL, getUser, outOfScope, setExecuteBatch, setPassword, setPreFetch, setStmtCacheSize, setURL, setUser
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    SqljConnBean

    public SqljConnBean()
                 throws java.sql.SQLException
    Method Detail

    setContextClass

    public void setContextClass(java.lang.String className)
    Set the fully qualified name of the underlying connection context class.

    getContextClass

    public java.lang.String getContextClass()
    Get the fully qualified name of the underlying connection context class.
    Returns:
    the fully qualified name of the underlying connection context class

    getDefaultContext

    public DefaultContext getDefaultContext()
                                     throws java.sql.SQLException
    Returns a connection context of Type DefaultContext.

    If no connection context is created previously, i.e., not "getContext" or "getDefaultContext" methods are called before, a DefaultContext instance will be created and returned.

    If the current connection context is a DefaultContext instance, then return the current context.

    If the current connection context is not a DefaultContext instance, then close that connection context and creates a DefaultContext instance. When the connection context is closed, the JDBC connection assoicated with that connection context is not closed. The JDBC connection is in turn associated with the newly created connection context.

    Throws:
    java.sql.SQLException - the connection context cannot be created.

    getContext

    public ConnectionContext getContext()
                                 throws java.sql.SQLException
    Returns a connection context, whose type is determine by the bean property "ContextClass".

    If "ContextClass" is not defined, returns the same result as the method "getDefaultContext()".

    Throws:
    java.sql.SQLException - the connection context cannot be created.
    See Also:

    If no connection context is created previously, i.e., not "getContext" or "getDefaultContext" methods are called before, an instance of "ContextClass" will be created and returned.

    If the current connection context is an instance of ContextClass, then return the current context.

    If the current connection context is not an instnace of ContextClass, then close that connection context and creates a ContextClass instance. When the connection context is closed, the JDBC connection assoicated with that connection context is not closed. The JDBC connection is in turn associated with the newly created connection context.


    getContext

    public ConnectionContext getContext(java.lang.Class ctxClass)
                                 throws java.sql.SQLException
    Returns a connection context, whose type is determine by the parameter "ctxClass".

    If no connection context is created previously, i.e., not "getContext" or "getDefaultContext" methods are called before, an instance of "ctxClass" will be created and returned.

    If the current connection context is an instance of ctxClass, then return the current context.

    If the current connection context is not an instnace of ctxClass, then close that connection context and creates a ContextClass instance. When the connection context is closed, the JDBC connection assoicated with that connection context is not closed. The JDBC connection is in turn associated with the newly created connection context.

    Parameters:
    ctxClass - the type of the returned connection context.
    Throws:
    java.sql.SQLException - the connection context cannot be created.

    getDefaultContext

    public DefaultContext getDefaultContext(boolean autoCommit)
                                     throws java.sql.SQLException
    Returns the same result as getDefaultContext, except that the auto-commit staus in the underline JDBC connection is reseted according to the parameter.
    Parameters:
    autoCommit - the auto-commit setting for the underlying JDBC connection.
    Throws:
    java.sql.SQLException - the connection context cannot be created.
    See Also:
    getDefaultContext()

    getContext

    public ConnectionContext getContext(boolean autoCommit)
                                 throws java.sql.SQLException
    Returns the same result as getContext, except that the auto-commit staus in the underline JDBC connection is reseted according to the parameter.
    Parameters:
    autoCommit - the auto-commit setting for the underlying JDBC connection.
    Throws:
    java.sql.SQLException - the connection context cannot be created.

    getContext

    public ConnectionContext getContext(java.lang.Class ctxClass,
                                        boolean autoCommit)
                                 throws java.sql.SQLException
    Returns the same result as getContext(Class), except that the auto-commit staus in the underline JDBC connection is reseted according to the parameter.
    Parameters:
    ctxClass - the type of the returned connection context
    autoCommit - the auto-commit setting for the underlying JDBC connection.
    Throws:
    java.sql.SQLException - the connection context cannot be created.
    See Also:
    getContext(Class)