org.hsqldb
Class Session

java.lang.Object
  extended byorg.hsqldb.Session
All Implemented Interfaces:
SessionInterface

public class Session
extends Object
implements SessionInterface

Implementation of a user session with the database. In 1.7.2 Session becomes the public interface to an HSQLDB database, accessed locally or remotely via SessionInterface. When as Session is closed, all references to internal engine objects are set to null. But the session id and scripting mode may still be used for scripting

Version:
1.7.2

Method Summary
 void close()
          Closes this Session.
 void commit()
          Commits any uncommited transaction this Session may have open
 Result execute(Result cmd)
          Executes the command encapsulated by the cmd argument.
 int getId()
          Retrieves the session identifier for this Session.
 boolean isAutoCommit()
          Getter for autoCommit attribute.
 boolean isClosed()
          Retrieves whether this Session is closed.
 boolean isReadOnly()
          Getter for readonly attribute.
 void rollback()
          Rolls back any uncommited transaction this Session may have open.
 void setAutoCommit(boolean autocommit)
          Setter for the autocommit attribute.
 void setReadOnly(boolean readonly)
          Setter for readonly attribute.
 Result sqlExecuteDirectNoPreChecks(String sql)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getId

public int getId()
Retrieves the session identifier for this Session.

Specified by:
getId in interface SessionInterface
Returns:
the session identifier for this Session

close

public void close()
Closes this Session.

Specified by:
close in interface SessionInterface

isClosed

public boolean isClosed()
Retrieves whether this Session is closed.

Specified by:
isClosed in interface SessionInterface
Returns:
true if this Session is closed

setAutoCommit

public void setAutoCommit(boolean autocommit)
Setter for the autocommit attribute.

Specified by:
setAutoCommit in interface SessionInterface
Parameters:
autocommit - the new value
Throws:
HsqlException

commit

public void commit()
Commits any uncommited transaction this Session may have open

Specified by:
commit in interface SessionInterface
Throws:
HsqlException

rollback

public void rollback()
Rolls back any uncommited transaction this Session may have open.

Specified by:
rollback in interface SessionInterface
Throws:
HsqlException

setReadOnly

public void setReadOnly(boolean readonly)
                 throws HsqlException
Setter for readonly attribute.

Specified by:
setReadOnly in interface SessionInterface
Parameters:
readonly - the new value
Throws:
HsqlException

isReadOnly

public boolean isReadOnly()
Getter for readonly attribute.

Specified by:
isReadOnly in interface SessionInterface
Returns:
the current value

isAutoCommit

public boolean isAutoCommit()
Getter for autoCommit attribute.

Specified by:
isAutoCommit in interface SessionInterface
Returns:
the current value

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

sqlExecuteDirectNoPreChecks

public Result sqlExecuteDirectNoPreChecks(String sql)


Copyright © 2001 - 2004 HSQL Development Group. All Rights Reserved.