Java Doc for Session.java in  » Database-DBMS » hsql » org » hsqldb » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » hsql » org.hsqldb 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.hsqldb.Session

Session
public class Session implements SessionInterface(Code)
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 New class based based on original Hypersonic code. Extensively rewritten and extended in successive versions of HSQLDB.
author:
   Thomas Mueller (Hypersonic SQL Group)
version:
   1.8.0
since:
   1.7.0


Field Summary
 longactionTimestamp
    
 CompiledStatementExecutorcompiledStatementExecutor
    
 CompiledStatementManagercompiledStatementManager
    
 DatecurrentDate
    
 longcurrentDateTimeSCN
    
 longcurrentMillis
    
public  HsqlNamecurrentSchema
    
 TimecurrentTime
    
 TimestampcurrentTimestamp
    
 Databasedatabase
    
 DatabaseCommandInterpreterdbCommandInterpreter
    
final static  ResultemptyUpdateCount
    
 booleanisProcessingLog
    
 booleanisProcessingScript
    
 intisolationMode
    
public  HsqlNameloggedSchema
    
 HsqlArrayListrowActionList
    
 HashMappedListsavepoints
    
 HsqlArrayListsqlWarnings
    
 longtransactionTimestamp
    

Constructor Summary
 Session(Database db, User user, boolean autocommit, boolean readonly, int id)
     Constructs a new Session object.

Method Summary
 booleanaddDeleteAction(Table table, Row row)
     Adds a single-row deletion step to the transaction UNDO buffer.
 booleanaddInsertAction(Table table, Row row)
     Adds a single-row insertion step to the transaction UNDO buffer.
public  voidaddWarning(HsqlException warning)
    
 voidbeginNestedTransaction()
     Starts a nested transaction.
 voidcheck(HsqlName object, int right)
     Checks whether this Session's current User has the set of rights specified by the right argument, in relation to the database object identifier specified by the object argument.
 voidcheck(String object)
    
 voidcheckAdmin()
     Checks whether this Session's current User has the privileges of the ADMIN role.
 voidcheckDDLWrite()
     This is used for creating new database objects such as tables.
 voidcheckReadWrite()
     This is used for reading - writing to existing tables.
 voidclearIndexRoots()
    
 voidclearIndexRootsKeep()
    
public  voidclose()
     Closes this Session.
public  voidcommit()
    
 voiddropIndex(HsqlName index, boolean preserve)
    
 voidendNestedTransaction(boolean rollback)
     Ends a nested transaction.
 voidendSchemaDefinition()
    
public  Resultexecute(Result cmd)
     Executes the command encapsulated by the cmd argument.
public  HsqlException[]getAndClearWarnings()
    
 ResultgetAttributes()
    
public  StringgetAutoCommitStatement()
    
 longgetConnectTime()
     Getter for connectTime attribute.
 DategetCurrentDate()
     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.

 TimegetCurrentTime()
    
 TimestampgetCurrentTimestamp()
    
 DatabasegetDatabase()
     Retrieves the Database instance to which this Session represents a connection.
public  intgetId()
     Retrieves the session identifier for this Session.
 NodegetIndexRoot(HsqlName index, boolean preserve)
    
 jdbcConnectiongetInternalConnection()
     Retrieves an internal Connection object equivalent to the one that created this Session.
public  StringgetInternalConnectionURL()
    
public  intgetIsolation()
    
 NumbergetLastIdentity()
     Getter for iLastIdentity attribute.
 intgetMaxRows()
    
 intgetSQLMaxRows()
    
 HsqlNamegetSchemaHsqlName(String name)
     If schemaName is null, return the current schema name, else return the HsqlName object for the schema.
 HsqlNamegetSchemaHsqlNameForWrite(String name)
     If schemaName is null, return the current schema name, else return the HsqlName object for the schema.
public  StringgetSchemaName(String name)
    
public  StringgetSchemaNameForWrite(String name)
    
 booleangetScripting()
     Getter for scripting attribute.
 SessiongetSession()
    
 intgetTransactionSize()
     Getter for transactionSise attribute.
public  UsergetUser()
     Retrieves the User object representing the user currently controlling this Session.
 StringgetUsername()
     Retrieves the name, as known to the database, of the user currently controlling this Session.
 booleanisAccessible(String dbobject)
     Retrieves whether the database object identifier by the dbobject argument is accessible by the current Session User.
 booleanisAccessible(HsqlName dbobject)
    
 booleanisAdmin()
     Getter for admin attribute.
public  booleanisAutoCommit()
     Getter for autoCommit attribute.
public  booleanisClosed()
     Retrieves whether this Session is closed.
 booleanisNestedTransaction()
     Getter for nestedTransaction attribute.
 booleanisProcessingLog()
    
 booleanisProcessingScript()
    
public  booleanisReadOnly()
     Getter for readonly attribute.
 booleanisSchemaDefintion()
    
public  voidprepareCommit()
    
 voidreleaseSavepoint(String name)
     Implements release of named SAVEPOINT.
 voidresetSchema()
    
public  voidresetSession()
    
public  voidrollback()
     Rolls back any uncommited transaction this Session may have open.
 voidrollbackToSavepoint(String name)
     Implements a partial transaction ROLLBACK.
 voidsavepoint(String name)
     Implements a transaction SAVEPOINT.
 ResultsetAttributes(Result r)
    
public  voidsetAutoCommit(boolean autocommit)
     Setter for the autocommit attribute.
 voidsetIndexRoot(HsqlName index, boolean preserve, Node root)
    
public  voidsetIsolation(int level)
    
 voidsetLastIdentity(Number i)
     Setter for iLastIdentity attribute.
public  voidsetReadOnly(boolean readonly)
     Setter for readonly attribute.
 voidsetSQLMaxRows(int rows)
     The SQL command SET MAXROWS n will override the Statement.setMaxRows(n) until SET MAXROWS 0 is issued. NB this is dedicated to the SET MAXROWS sql statement and should not otherwise be called.
public  voidsetSchema(String schema)
    
 voidsetScripting(boolean script)
     A switch to set scripting on the basis of type of statement executed. A method in DatabaseCommandInterpreter.java sets this value to false before other methods are called to act on an SQL statement, which may set this to true.
 voidsetUser(User user)
     Sets this Session's User object to the one specified by the user argument.
 CompiledStatementsqlCompileStatement(String sql)
    
 ResultsqlExecuteCompiledNoPreChecks(CompiledStatement cs, Object[] pvals)
    
public  ResultsqlExecuteDirectNoPreChecks(String sql)
    
public  voidstartPhasedTransaction()
    
 voidstartSchemaDefinition(String schema)
    

Field Detail
actionTimestamp
long actionTimestamp(Code)



compiledStatementExecutor
CompiledStatementExecutor compiledStatementExecutor(Code)



compiledStatementManager
CompiledStatementManager compiledStatementManager(Code)



currentDate
Date currentDate(Code)



currentDateTimeSCN
long currentDateTimeSCN(Code)



currentMillis
long currentMillis(Code)



currentSchema
public HsqlName currentSchema(Code)



currentTime
Time currentTime(Code)



currentTimestamp
Timestamp currentTimestamp(Code)



database
Database database(Code)



dbCommandInterpreter
DatabaseCommandInterpreter dbCommandInterpreter(Code)



emptyUpdateCount
final static Result emptyUpdateCount(Code)



isProcessingLog
boolean isProcessingLog(Code)



isProcessingScript
boolean isProcessingScript(Code)



isolationMode
int isolationMode(Code)



loggedSchema
public HsqlName loggedSchema(Code)



rowActionList
HsqlArrayList rowActionList(Code)



savepoints
HashMappedList savepoints(Code)



sqlWarnings
HsqlArrayList sqlWarnings(Code)



transactionTimestamp
long transactionTimestamp(Code)




Constructor Detail
Session
Session(Database db, User user, boolean autocommit, boolean readonly, int id)(Code)
Constructs a new Session object.
Parameters:
  db - the database to which this represents a connection
Parameters:
  user - the initial user
Parameters:
  autocommit - the initial autocommit value
Parameters:
  readonly - the initial readonly value
Parameters:
  id - the session identifier, as known to the database




Method Detail
addDeleteAction
boolean addDeleteAction(Table table, Row row) throws HsqlException(Code)
Adds a single-row deletion step to the transaction UNDO buffer.
Parameters:
  table - the table from which the row was deleted
Parameters:
  row - the deleted row
throws:
  HsqlException -



addInsertAction
boolean addInsertAction(Table table, Row row) throws HsqlException(Code)
Adds a single-row insertion step to the transaction UNDO buffer.
Parameters:
  table - the table into which the row was inserted
Parameters:
  row - the inserted row
throws:
  HsqlException -



addWarning
public void addWarning(HsqlException warning)(Code)



beginNestedTransaction
void beginNestedTransaction() throws HsqlException(Code)
Starts a nested transaction.
throws:
  HsqlException -



check
void check(HsqlName object, int right) throws HsqlException(Code)
Checks whether this Session's current User has the set of rights specified by the right argument, in relation to the database object identifier specified by the object argument.
Parameters:
  object - the database object to check
Parameters:
  right - the rights to check for
throws:
  HsqlException - if the Session User does not have such rights



check
void check(String object) throws HsqlException(Code)
Checks the rights on a function
Parameters:
  object - the function
throws:
  HsqlException - if the Session User does not have such rights



checkAdmin
void checkAdmin() throws HsqlException(Code)
Checks whether this Session's current User has the privileges of the ADMIN role.
throws:
  HsqlException - if this Session's User does not have theprivileges of the ADMIN role.



checkDDLWrite
void checkDDLWrite() throws HsqlException(Code)
This is used for creating new database objects such as tables.
throws:
  HsqlException -



checkReadWrite
void checkReadWrite() throws HsqlException(Code)
This is used for reading - writing to existing tables.
throws:
  HsqlException -



clearIndexRoots
void clearIndexRoots()(Code)
clear default temp table contents for this session



clearIndexRootsKeep
void clearIndexRootsKeep()(Code)
clear ON COMMIT PRESERVE temp table contents for this session



close
public void close()(Code)
Closes this Session.



commit
public void commit()(Code)
Commits any uncommited transaction this Session may have open
throws:
  HsqlException -



dropIndex
void dropIndex(HsqlName index, boolean preserve)(Code)



endNestedTransaction
void endNestedTransaction(boolean rollback) throws HsqlException(Code)
Ends a nested transaction.
Parameters:
  rollback - true to roll back or false to commit the nested transaction
throws:
  HsqlException -



endSchemaDefinition
void endSchemaDefinition() throws HsqlException(Code)



execute
public Result execute(Result cmd)(Code)
Executes the command encapsulated by the cmd argument.
Parameters:
  cmd - the command to execute the result of executing the command



getAndClearWarnings
public HsqlException[] getAndClearWarnings()(Code)



getAttributes
Result getAttributes()(Code)



getAutoCommitStatement
public String getAutoCommitStatement()(Code)



getConnectTime
long getConnectTime()(Code)
Getter for connectTime attribute. the value



getCurrentDate
Date getCurrentDate()(Code)
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)




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



getCurrentTimestamp
Timestamp getCurrentTimestamp()(Code)
Returns the current timestamp, unchanged for the duration of the current execution unit (statement)



getDatabase
Database getDatabase()(Code)
Retrieves the Database instance to which this Session represents a connection. the Database object to which this Session is connected



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



getIndexRoot
Node getIndexRoot(HsqlName index, boolean preserve)(Code)
get the root for a temp table index



getInternalConnection
jdbcConnection getInternalConnection() throws HsqlException(Code)
Retrieves an internal Connection object equivalent to the one that created this Session. internal connection.



getInternalConnectionURL
public String getInternalConnectionURL()(Code)



getIsolation
public int getIsolation() throws HsqlException(Code)



getLastIdentity
Number getLastIdentity()(Code)
Getter for iLastIdentity attribute. the current value



getMaxRows
int getMaxRows()(Code)



getSQLMaxRows
int getSQLMaxRows()(Code)



getSchemaHsqlName
HsqlName getSchemaHsqlName(String name) throws HsqlException(Code)
If schemaName is null, return the current schema name, else return the HsqlName object for the schema. If schemaName does not exist, throw.



getSchemaHsqlNameForWrite
HsqlName getSchemaHsqlNameForWrite(String name) throws HsqlException(Code)
If schemaName is null, return the current schema name, else return the HsqlName object for the schema. If schemaName does not exist, or schema readonly, throw.



getSchemaName
public String getSchemaName(String name) throws HsqlException(Code)
Same as above, but return string



getSchemaNameForWrite
public String getSchemaNameForWrite(String name) throws HsqlException(Code)
Same as above, but return string



getScripting
boolean getScripting()(Code)
Getter for scripting attribute. scripting for the last statement.



getSession
Session getSession()(Code)



getTransactionSize
int getTransactionSize()(Code)
Getter for transactionSise attribute. the current value



getUser
public User getUser()(Code)
Retrieves the User object representing the user currently controlling this Session. this Session's User object



getUsername
String getUsername()(Code)
Retrieves the name, as known to the database, of the user currently controlling this Session. the name of the user currently connected within this Session



isAccessible
boolean isAccessible(String dbobject) throws HsqlException(Code)
Retrieves whether the database object identifier by the dbobject argument is accessible by the current Session User. true if so, else false



isAccessible
boolean isAccessible(HsqlName dbobject) throws HsqlException(Code)



isAdmin
boolean isAdmin()(Code)
Getter for admin attribute.



isAutoCommit
public boolean isAutoCommit()(Code)
Getter for autoCommit attribute. the current value



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



isNestedTransaction
boolean isNestedTransaction()(Code)
Getter for nestedTransaction attribute. the current value



isProcessingLog
boolean isProcessingLog()(Code)



isProcessingScript
boolean isProcessingScript()(Code)



isReadOnly
public boolean isReadOnly()(Code)
Getter for readonly attribute. the current value



isSchemaDefintion
boolean isSchemaDefintion()(Code)



prepareCommit
public void prepareCommit() throws HsqlException(Code)



releaseSavepoint
void releaseSavepoint(String name) throws HsqlException(Code)
Implements release of named SAVEPOINT.
Parameters:
  name - Name of savepoint that was marked before by savepoint()call
throws:
  HsqlException - if name does not correspond to a savepoint



resetSchema
void resetSchema()(Code)



resetSession
public void resetSession() throws HsqlException(Code)
No-op in this implementation



rollback
public void rollback()(Code)
Rolls back any uncommited transaction this Session may have open.
throws:
  HsqlException -



rollbackToSavepoint
void rollbackToSavepoint(String name) throws HsqlException(Code)
Implements a partial transaction ROLLBACK.
Parameters:
  name - Name of savepoint that was marked before by savepoint()call
throws:
  HsqlException -



savepoint
void savepoint(String name) throws HsqlException(Code)
Implements a transaction SAVEPOINT. A new SAVEPOINT with the name of an existing one replaces the old SAVEPOINT.
Parameters:
  name - of the savepoint
throws:
  HsqlException - if there is no current transaction



setAttributes
Result setAttributes(Result r)(Code)



setAutoCommit
public void setAutoCommit(boolean autocommit)(Code)
Setter for the autocommit attribute.
Parameters:
  autocommit - the new value
throws:
  HsqlException -



setIndexRoot
void setIndexRoot(HsqlName index, boolean preserve, Node root)(Code)
set the root for a temp table index



setIsolation
public void setIsolation(int level) throws HsqlException(Code)



setLastIdentity
void setLastIdentity(Number i)(Code)
Setter for iLastIdentity attribute.
Parameters:
  i - the new value



setReadOnly
public void setReadOnly(boolean readonly) throws HsqlException(Code)
Setter for readonly attribute.
Parameters:
  readonly - the new value



setSQLMaxRows
void setSQLMaxRows(int rows)(Code)
The SQL command SET MAXROWS n will override the Statement.setMaxRows(n) until SET MAXROWS 0 is issued. NB this is dedicated to the SET MAXROWS sql statement and should not otherwise be called. (fredt@users)



setSchema
public void setSchema(String schema) throws HsqlException(Code)



setScripting
void setScripting(boolean script)(Code)
A switch to set scripting on the basis of type of statement executed. A method in DatabaseCommandInterpreter.java sets this value to false before other methods are called to act on an SQL statement, which may set this to true. Afterwards the method reponsible for logging uses getScripting() to determine if logging is required for the executed statement. (fredt@users)
Parameters:
  script - The new scripting value



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



sqlCompileStatement
CompiledStatement sqlCompileStatement(String sql) throws HsqlException(Code)



sqlExecuteCompiledNoPreChecks
Result sqlExecuteCompiledNoPreChecks(CompiledStatement cs, Object[] pvals)(Code)



sqlExecuteDirectNoPreChecks
public Result sqlExecuteDirectNoPreChecks(String sql)(Code)



startPhasedTransaction
public void startPhasedTransaction() throws HsqlException(Code)



startSchemaDefinition
void startSchemaDefinition(String schema) throws HsqlException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.