Documentation of 'org.hsqldb.Session' Java class
Session
org.hsqldb

Class Session

  • All Implemented Interfaces:
    SessionInterface


    public class Session
    extends java.lang.Object
    implements SessionInterface
    Implementation of SQL sessions.
    Since:
    1.7.0
    • Method Detail

      • getId

        public long getId()
        Retrieves the session identifier for this Session.
        Specified by:
        getId in interface SessionInterface
        Returns:
        the session identifier for this Session
      • isClosed

        public boolean isClosed()
        Retrieves whether this Session is closed.
        Specified by:
        isClosed in interface SessionInterface
        Returns:
        true if this Session is closed
      • setIsolation

        public void setIsolation(int level)
        sets ISOLATION for the next transaction only
      • getLastIdentity

        public java.lang.Number getLastIdentity()
        Getter for iLastIdentity attribute.
        Returns:
        the current value
      • getDatabase

        public Database getDatabase()
        Retrieves the Database instance to which this Session represents a connection.
        Returns:
        the Database object to which this Session is connected
      • getUsername

        public java.lang.String getUsername()
        Retrieves the name, as known to the database, of the user currently controlling this Session.
        Returns:
        the name of the user currently connected within this Session
      • getUser

        public User getUser()
        Retrieves the User object representing the user currently controlling this Session.
        Returns:
        this Session's User object
      • getGrantee

        public Grantee getGrantee()
      • getRole

        public Grantee getRole()
      • setUser

        public void setUser(User user)
        Sets this Session's User object to the one specified by the user argument.
        Parameters:
        user - the new User object for this session
      • setRole

        public void setRole(Grantee role)
      • getActionTimestamp

        public long getActionTimestamp()
      • addDeleteAction

        public void addDeleteAction(Table table,
                                    PersistentStore store,
                                    Row row,
                                    int[] colMap)
        Adds a delete action to the row and the transaction manager.
        Parameters:
        table - the table of the row
        row - the deleted row
        Throws:
        HsqlException
      • setAutoCommit

        public void setAutoCommit(boolean autocommit)
        Setter for the autocommit attribute.
        Specified by:
        setAutoCommit in interface SessionInterface
        Parameters:
        autocommit - the new value
        Throws:
        HsqlException
      • beginAction

        public void beginAction(Statement cs)
      • endAction

        public void endAction(Result result)
      • hasLocks

        public boolean hasLocks(Statement statement)
      • startTransaction

        public void startTransaction()
      • commit

        public void commit(boolean chain)
        Commits any uncommited transaction this Session may have open
        Specified by:
        commit in interface SessionInterface
        Throws:
        HsqlException
      • rollback

        public void rollback(boolean chain)
        Rolls back any uncommited transaction this Session may have open.
        Specified by:
        rollback in interface SessionInterface
        Throws:
        HsqlException
      • resetSession

        public void resetSession()
        Clear structures and reset variables to original. For JDBC use only.
        Specified by:
        resetSession in interface SessionInterface
      • savepoint

        public void savepoint(java.lang.String name)
        Registers a transaction SAVEPOINT. A new SAVEPOINT with the name of an existing one replaces the old SAVEPOINT.
        Specified by:
        savepoint in interface SessionInterface
        Parameters:
        name - name of the savepoint
        Throws:
        HsqlException - if there is no current transaction
      • rollbackToSavepoint

        public void rollbackToSavepoint(java.lang.String name)
        Performs a partial transaction ROLLBACK to savepoint.
        Specified by:
        rollbackToSavepoint in interface SessionInterface
        Parameters:
        name - name of savepoint
        Throws:
        HsqlException
      • rollbackToSavepoint

        public void rollbackToSavepoint()
        Performs a partial transaction ROLLBACK of current savepoint level.
        Throws:
        HsqlException
      • rollbackAction

        public void rollbackAction(int start,
                                   long timestamp)
      • releaseSavepoint

        public void releaseSavepoint(java.lang.String name)
        Releases a savepoint
        Specified by:
        releaseSavepoint in interface SessionInterface
        Parameters:
        name - name of savepoint
        Throws:
        HsqlException - if name does not correspond to a savepoint
      • isInMidTransaction

        public boolean isInMidTransaction()
      • setNoSQL

        public void setNoSQL()
      • setIgnoreCase

        public void setIgnoreCase(boolean mode)
      • isIgnorecase

        public boolean isIgnorecase()
      • setReadOnly

        public void setReadOnly(boolean readonly)
        sets READ ONLY for next transaction / subtransaction only
        Parameters:
        readonly - the new value
      • isReadOnly

        public boolean isReadOnly()
        Getter for readonly attribute.
        Returns:
        the current value
      • isAutoCommit

        public boolean isAutoCommit()
        Getter for autoCommit attribute.
        Specified by:
        isAutoCommit in interface SessionInterface
        Returns:
        the current value
      • isAdmin

        public boolean isAdmin()
        Getter for admin attribute.
        Returns:
        the current value
      • getConnectTime

        public long getConnectTime()
        Getter for connectTime attribute.
        Returns:
        the value
      • getTransactionSize

        public int getTransactionSize()
        Count of acctions in current transaction.
        Returns:
        the current value
      • getTransactionTimestamp

        public long getTransactionTimestamp()
      • compileStatement

        public Statement compileStatement(java.lang.String sql,
                                          int props)
      • compileStatement

        public Statement compileStatement(java.lang.String sql)
      • execute

        public Result execute(Result cmd)
        Executes the command encapsulated by the cmd argument.
        Specified by:
        execute in interface SessionInterface
        Parameters:
        cmd - the command to execute
        Returns:
        the result of executing the command
      • executeDirectStatement

        public Result executeDirectStatement(Result cmd)
      • executeDirectStatement

        public Result executeDirectStatement(java.lang.String sql)
      • executeCompiledStatement

        public Result executeCompiledStatement(Statement cs,
                                               java.lang.Object[] pvals,
                                               int timeout)
      • getCurrentDate

        public TimestampData getCurrentDate()
        Returns the current date, unchanged for the duration of the current execution unit (statement).

        SQL standards require that CURRENT_DATE, CURRENT_TIME and CURRENT_TIMESTAMP are all evaluated at the same point of time in the duration of each SQL statement, no matter how long the SQL statement takes to complete.

        When this method or a corresponding method for CURRENT_TIME or CURRENT_TIMESTAMP is first called in the scope of a system change number, currentMillis is set to the current system time. All further CURRENT_XXXX calls in this scope will use this millisecond value. (fredt@users)

        Specified by:
        getCurrentDate in interface SessionInterface
      • registerResultLobs

        public void registerResultLobs(Result result)
      • setSchema

        public void setSchema(java.lang.String schema)
      • setCatalog

        public void setCatalog(java.lang.String catalog)
      • getSchemaName

        public java.lang.String getSchemaName(java.lang.String name)
        Same as above, but return string
      • getResultMemoryRowCount

        public int getResultMemoryRowCount()
      • setResultMemoryRowCount

        public void setResultMemoryRowCount(int count)
      • getAndClearWarnings

        public HsqlException[] getAndClearWarnings()
      • clearWarnings

        public void clearWarnings()
      • setZoneSeconds

        public void setZoneSeconds(int seconds)
      • random

        public double random(long seed)
      • random

        public double random()

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.