Top Description Inners Fields Constructors Methods
org.hsqldb

public Class Session

extends Object
implements SessionInterface
Class Inheritance
All Implemented Interfaces
org.hsqldb.SessionInterface
Imports
java.text.SimpleDateFormat, java.util.Calendar, .GregorianCalendar, .Random, .TimeZone, org.hsqldb.HsqlNameManager.HsqlName, org.hsqldb.error.Error, .ErrorCode, org.hsqldb.jdbc.JDBCConnection, .JDBCDriver, org.hsqldb.lib.ArrayUtil, .CountUpDownLatch, .HashMap, .HsqlArrayList, .HsqlDeque, .Iterator, .OrderedHashSet, .SimpleLog, org.hsqldb.map.ValuePool, org.hsqldb.navigator.RowSetNavigator, .RowSetNavigatorClient, org.hsqldb.persist.HsqlDatabaseProperties, .HsqlProperties, .PersistentStore, org.hsqldb.result.Result, .ResultConstants, .ResultLob, .ResultProperties, org.hsqldb.rights.Grantee, .User, org.hsqldb.types.BlobDataID, .ClobDataID, .DateTimeType, .HsqlDateTime, .TimeData, .TimestampData, .Type, .TypedComparator

Implementation of SQL sessions.
Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
1.7.0
Version
2.7.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
pack-priv volatile boolean
pack-priv volatile boolean
pack-priv int
pack-priv long
pack-priv OrderedHashSet<RowActionBase>
pack-priv long
private Calendar
private Calendar
pack-priv HsqlProperties
private final TimestampData
private TimestampData
public HsqlNameManager.HsqlName
private TimeData
private TimestampData
pack-priv long
pack-priv TimeZone
public Database
private JDBCConnection
private boolean
private JDBCConnection
pack-priv boolean
private volatile boolean
pack-priv boolean
pack-priv int
pack-priv int
pack-priv volatile boolean
pack-priv boolean
pack-priv boolean
public boolean
pack-priv boolean
pack-priv volatile boolean
public CountUpDownLatch
private TimeData
private TimestampData
public HsqlNameManager.HsqlName
pack-priv ParserCommand
pack-priv Random
public final int
pack-priv volatile boolean
pack-priv int
private Grantee
pack-priv HsqlArrayList<RowAction>
pack-priv Scanner
pack-priv long
public SessionContext
public SessionData
private final long
private int
pack-priv int
public int
private final User
pack-priv SimpleDateFormat
pack-priv SimpleDateFormat
public Object
pack-priv HsqlDeque<HsqlException>
public StatementManager
pack-priv long
pack-priv OrderedHashSet<Session>
pack-priv volatile boolean
pack-priv Session.TimeoutManager
pack-priv final TimeZone
pack-priv long
pack-priv long
private TimestampData
pack-priv boolean
pack-priv final boolean
pack-priv final boolean
pack-priv TypedComparator
private User
public OrderedHashSet<Session>
public OrderedHashSet<Session>
pack-priv final String

Constructor Summary

AccessConstructor and Description
pack-priv
Session(Database
the database to which this represents a connection
db
,
User
the initial user
user
,
boolean
the initial autocommit value
autocommit
,
boolean
the initial readonly value
readonly
,
long
the session identifier, as known to the database
id
,
TimeZone
the TimeZone
zone
)

Constructs a new Session object.

Method Summary

Modifier and TypeMethod and Description
public void
addDeleteAction(Table
the table of the row
table
,
PersistentStore store, Row
the deleted row
row
,
int[] changedColumns)

Adds a delete action to the row and the transaction manager.

pack-priv void
addInsertAction(Table table, PersistentStore store, Row row, int[] changedColumns)

public void
public Result
pack-priv static void
appendIsolationSQL(StringBuilder sb, int isolationLevel)

public void
public Result
pack-priv void
checkAdmin()

Checks whether this Session's current User has the privileges of the ADMIN role.

pack-priv void
checkDDLWrite()

This is used for creating new database objects such as tables.

pack-priv void
checkReadWrite()

This is used for reading - writing to existing tables.

public void
public synchronized void
close()

Implements org.hsqldb.SessionInterface.close.

Closes this Session.

public synchronized void
public synchronized void
commit(boolean chain)

Implements org.hsqldb.SessionInterface.commit.

Commits any uncommitted transaction this Session may have open

public Statement
compileStatement(String sql, int props)

public Statement
public BlobDataID
public ClobDataID
public void
endAction(Result result)

private void
endTransaction(boolean commit, boolean chain)

public synchronized Result

Returns:

the result of executing the command
execute
(Result
the command to execute
cmd
)

Implements org.hsqldb.SessionInterface.execute.

Executes the command encapsulated by the cmd argument.

private Result
public Result
executeCompiledStatement(Statement cs, Object[] pvals, int timeout)

private Result
public Result
public Result
private Result

Returns:

the result of executing the statement
executeResultUpdate
(Result cmd)

Retrieves the result of inserting, updating or deleting a row from an updatable result.

public long
public HsqlException[]
public synchronized Object
public Result
public Calendar
public Calendar
public HsqlProperties
public TypedComparator
public TimestampData

Returns:

the value
getConnectTimestamp
()

Getter for connectTime attribute.

public synchronized TimestampData
public HsqlNameManager.HsqlName
pack-priv synchronized TimeData
getCurrentTime()

Returns the current time, unchanged for the duration of the current execution unit (statement)

pack-priv synchronized TimestampData
getCurrentTimestamp()

Returns the current date/time, unchanged for the duration of the current execution unit (statement).

public Database

Returns:

the Database object to which this Session is connected
getDatabase
()

Retrieves the Database instance to which this Session represents a connection.

public String
public Grantee
public long

Returns:

the session identifier for this Session
getId
()

Implements org.hsqldb.SessionInterface.getId.

Retrieves the session identifier for this Session.

pack-priv JDBCConnection

Returns:

internal connection.
getInternalConnection
()

Retrieves an internal Connection object equivalent to the one that created this Session.

public String
public synchronized int
pack-priv static String
getIsolationString(int isolationLevel)

public JDBCConnection
getJDBCConnection()

Implements org.hsqldb.SessionInterface.getJDBCConnection.

Retrieves the external JDBC connection

public Number

Returns:

the current value
getLastIdentity
()

Getter for iLastIdentity attribute.

public HsqlException
pack-priv synchronized TimeData
pack-priv synchronized TimestampData
pack-priv int
public int
public int
public Grantee
public HsqlArrayList<RowAction>
public RowSetNavigatorClient
getRows(long navigatorId, int offset, int blockSize)

Implements org.hsqldb.SessionInterface.getRows.

public Scanner
pack-priv HsqlNameManager.HsqlName
getSchemaHsqlName(String name)

If schemaName is null, return the current schema name, else return the HsqlName object for the schema.

public String
getSchemaName(String name)

Same as above, but return string

pack-priv String
public Result
pack-priv String
public SimpleDateFormat
pack-priv String
public synchronized int
public TimeZone
pack-priv String
public long
public int

Returns:

the current value
getTransactionSize
()

Count of actions in current transaction.

pack-priv TimestampData
public User

Returns:

this Session's User object
getUser
()

Retrieves the User object representing the user currently controlling this Session.

public String

Returns:

the name of the user currently connected within this Session
getUsername
()

Retrieves the name, as known to the database, of the user currently controlling this Session.

public int
private Result
public boolean

Returns:

the current value
isAdmin
()

Getter for admin attribute.

public synchronized boolean

Returns:

the current value
isAutoCommit
()

Implements org.hsqldb.SessionInterface.isAutoCommit.

Getter for autoCommit attribute.

public boolean

Returns:

true if this Session is closed
isClosed
()

Implements org.hsqldb.SessionInterface.isClosed.

Retrieves whether this Session is closed.

public boolean
public boolean
public boolean
public boolean
public boolean

Returns:

the current value
isReadOnly
()

Getter for readonly attribute.

public synchronized boolean
pack-priv void
pack-priv Result
private Result
performPostExecute(Result command, Result result)

public synchronized void
public double
random(long seed)

public double
public void
pack-priv void
public synchronized void
releaseSavepoint(String
name of savepoint
name
)

Implements org.hsqldb.SessionInterface.releaseSavepoint.

Releases a savepoint

private void
pack-priv void
public synchronized void
resetSession()

Implements org.hsqldb.SessionInterface.resetSession.

Clear structures and reset variables to original.

public void
public synchronized void
rollback(boolean chain)

Implements org.hsqldb.SessionInterface.rollback.

Rolls back any uncommitted transaction this Session may have open.

public synchronized void
rollbackAction(int start, long timestamp)

pack-priv synchronized void
rollbackNoCheck(boolean chain)

public synchronized void
rollbackToSavepoint(String
name of savepoint
name
)

Implements org.hsqldb.SessionInterface.rollbackToSavepoint.

Performs a partial transaction ROLLBACK to savepoint.

public synchronized void
rollbackToSavepoint()

Performs a partial transaction ROLLBACK of current savepoint level.

public synchronized void
savepoint(String
name of the savepoint
name
)

Implements org.hsqldb.SessionInterface.savepoint.

Registers a transaction SAVEPOINT.

public synchronized void
public void
setAttributeFromResult(Result result)

Implements org.hsqldb.SessionInterface.setAttributeFromResult.

no-op, only for ClientConnection

private Result
public synchronized void
setAutoCommit(boolean
the new value
autocommit
)

Implements org.hsqldb.SessionInterface.setAutoCommit.

Setter for the autocommit attribute.

public void
public void
setCatalog(String catalog)

public void
pack-priv void
setFeature(String feature, boolean value)

public void
setIgnoreCase(boolean mode)

public void
setIsolation(int level)

sets ISOLATION for the next transaction only

public synchronized void
public void
pack-priv void
setLastIdentity(Number
the new value
i
)

Setter for iLastIdentity attribute.

public void
public void
setReadOnly(boolean
the new value
readonly
)

sets READ ONLY for next transaction / subtransaction only

public synchronized void
public void
public void
public void
setSchema(String schema)

pack-priv void
setSQLMaxRows(int rows)

The SQL command SET MAXROWS n will override the Statement.setMaxRows(n) for the next direct statement only NB this is dedicated to the SET MAXROWS sql statement and should not otherwise be called.

public void
public void
setUser(User
the new User object for this session
user
)

Sets this Session's User object to the one specified by the user argument.

public synchronized void
public void
startTransaction()

Explicit start of transaction by user

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait