Java Doc for Database.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.Database

Database
class Database implements MessageListener,MembershipListener(Code)
Database is the root class for HSQL Database Engine database.

Although it either directly or indirectly provides all or most of the services required for DBMS functionality, this class should not be used directly by an application. Instead, to achieve portability and generality, the jdbc* classes should be used.
version:
   1.7.0


Inner Class :class Logger

Field Summary
 Loggerlogger
    

Constructor Summary
 Database(String name)
     Constructs a new Database object that mounts or creates the database files specified by the supplied name.

Method Summary
public  voidblock()
    
synchronized  Sessionconnect(String username, String password)
     Constructs a new Session that operates within (is connected to) the context of this Database object.
 voiddropTable(String name, boolean ifExists, boolean isView, Session session)
     Drops the specified user-defined view or table from this Database object.
 byte[]execute(String user, String password, String statement)
     A specialized SQL statement executor, tailored for use by WebServerConnection .
synchronized  Resultexecute(String statement, Session session)
    
synchronized  Resultexecute(String statement, Session session, boolean replicate)
     The main SQL statement executor.
public  voidfinalize()
     Called by the garbage collector on this Databases object when garbage collection determines that there are no more references to it.
 TablefindUserTable(String name)
    
 TablefindUserTable(String name, Session session)
    
 HsqlHashMapgetAlias()
     Retrieves a map from Java method-call name aliases to the fully-qualified names of the Java methods themsleves.
 StringgetAlias(String s)
     Retieves a Java method's fully qualified name, given a String that is supposedly an alias for it.
 StringgetName()
     Retrieves this Database object's name, as know to this Database object.
 HsqlDatabasePropertiesgetProperties()
     Retrieves this Database object's properties.
 ResultgetScript(boolean drop, boolean insert, boolean cached, Session session)
     Generates a SQL script containing all or part of the SQL statements required to recreate the current state of this Database object.
public  ObjectgetState()
    
 TablegetTable(String name, Session session)
     Retrieves the specified user defined table or view visible within the context of the specified Session, or any system table of the given name.
 intgetTableIndex(Table table)
     Retrieves the index of a table or view in the HsqlArrayList that contains these objects for a Database.
 HsqlArrayListgetTables()
     Retrieves a HsqlArrayList containing references to all registered non-system tables and views.
 UserManagergetUserManager()
     Retrieves the UserManager object for this Database.
 TablegetUserTable(String name, Session session)
    
 TablegetUserTable(String name)
    
 booleanisIgnoreCase()
     isIgnoreCase attribute getter.
 booleanisReferentialIntegrity()
     isReferentialIntegrity attribute getter.
 booleanisShutdown()
     isShutdown attribute getter.
 voidlinkTable(Table t)
     Attempts to register the specified table or view with this Database object.
 StringprintMessage(Message msg)
    
 TempConstraintprocessCreateFK(Tokenizer c, Session session, Table t, HsqlName cname)
    
public  voidreceive(Message msg)
    
 voidregisterSession(Session session)
     Binds the specified Session object into this Database object's active session registry.
 voidremoveExportedKeys(Table toDrop)
     Removes any foreign key Constraint objects (exported keys) held by any tables referenced by the specified table.
 voidsetReadOnly()
     Puts this Database object in global read-only mode.
 voidsetReferentialIntegrity(boolean ref)
     isReferentialIntegrity attribute setter.
public  voidsetState(Object state)
    
public  voidsuspect(Address suspected_mbr)
    
public  voidviewAccepted(org.javagroups.View new_view)
    

Field Detail
logger
Logger logger(Code)




Constructor Detail
Database
Database(String name) throws SQLException(Code)
Constructs a new Database object that mounts or creates the database files specified by the supplied name.
Parameters:
  name - the path to and common name shared by the database filesthis Database uses
exception:
  SQLException - if the specified path and common namecombination is illegal or unavailable, or the database files thename resolves to are in use by another process




Method Detail
block
public void block()(Code)
Block sending and receiving of messages until viewAccepted() is called



connect
synchronized Session connect(String username, String password) throws SQLException(Code)
Constructs a new Session that operates within (is connected to) the context of this Database object.

If successful, the new Session object initially operates on behalf of the user specified by the supplied user name.
Parameters:
  username - the name of the initial user of this session. The usermust already exist in this Database object.
Parameters:
  password - the password of the specified user. This must matchthe password, as known to this Database object, of the specifieduser a new Session object that initially that initially operates onbehalf of the specified user
throws:
  SQLException - if the specified user does not exist or a badpassword is specified




dropTable
void dropTable(String name, boolean ifExists, boolean isView, Session session) throws SQLException(Code)
Drops the specified user-defined view or table from this Database object.

The process of dropping a table or view includes:

  1. checking that the specified Session's currently connected User has the right to perform this operation and refusing to proceed if not by throwing.
  2. checking for referential constraints that conflict with this operation and refusing to proceed if they exist by throwing.
  3. removing the specified Table from this Database object.
  4. removing any exported foreign keys Constraint objects held by any tables referenced by the table to be dropped. This is especially important so that the dropped Table ceases to be referenced, eventually allowing its full garbage collection.


Parameters:
  name - of the table or view to drop
Parameters:
  ifExists - if true and if the Table to drop does not exist, failsilently, else throw
Parameters:
  isView - true if the name argument refers to a View
Parameters:
  session - the connected context in which to perform thisoperation
throws:
  SQLException - if any of the checks listed above fail




execute
byte[] execute(String user, String password, String statement)(Code)
A specialized SQL statement executor, tailored for use by WebServerConnection . Calling this method fully connects the specified user, executes the specifed statement, and then disconects.
Parameters:
  user - the name of the user for which to execute the specifiedstatement. The user must already exist in this Database object.
Parameters:
  password - the password of the specified user. This must matchthe password, as known to this Database object, of the specifieduser
Parameters:
  statement - the SQL statement to execute the result of executing the specified statement, in a formalready suitable for transmitting as part of an HTTP response.



execute
synchronized Result execute(String statement, Session session)(Code)



execute
synchronized Result execute(String statement, Session session, boolean replicate)(Code)
The main SQL statement executor.

All requests to execute SQL statements against this Database object eventually go through this method.
Parameters:
  statement - the SQL statement to execute
Parameters:
  session - an object representing a connected user and acollection of session state attributes
Parameters:
  replicate - If set the change will be replicated to other replicas. This is usedby the internal replication the result of executing the specified statement, in a formsuitable for either wrapping in a local ResultSet object or fortransmitting to a remote client via the native HSQLDB protocol




finalize
public void finalize()(Code)
Called by the garbage collector on this Databases object when garbage collection determines that there are no more references to it.



findUserTable
Table findUserTable(String name)(Code)



findUserTable
Table findUserTable(String name, Session session)(Code)



getAlias
HsqlHashMap getAlias()(Code)
Retrieves a map from Java method-call name aliases to the fully-qualified names of the Java methods themsleves. a map in the form of a HsqlHashMap



getAlias
String getAlias(String s)(Code)
Retieves a Java method's fully qualified name, given a String that is supposedly an alias for it.

This is somewhat of a misnomer, since it is not an alias that is being retrieved, but rather what the supplied alias maps to. If the specified alias does not map to any registered Java method fully-qualified name, then the specified String itself is returned.
Parameters:
  s - a call name alias that supposedly maps to a registered Javamethod a Java method fully-qualified name, or null if no method isregistered with the given alias




getName
String getName()(Code)
Retrieves this Database object's name, as know to this Database object. this Database object's name



getProperties
HsqlDatabaseProperties getProperties()(Code)
Retrieves this Database object's properties. this Database object's properties object



getScript
Result getScript(boolean drop, boolean insert, boolean cached, Session session) throws SQLException(Code)
Generates a SQL script containing all or part of the SQL statements required to recreate the current state of this Database object.
Parameters:
  drop - if true, include drop statements for each droppabledatabase object
Parameters:
  insert - if true, include the insert statements required topopulate each of this Database object's memory tables to matchtheir current state.
Parameters:
  cached - if true, include the insert statement required topopulate each of this Database object's CACHED tables to matchtheir current state.
Parameters:
  session - the Session in which to generate the requested SQLscript A Result object consisting of one VARCHAR column with a rowfor each statement in the generated script
throws:
  SQLException - if the specified Session's currently connectedUser does not have the right to call this method or there is someproblem generating the result



getState
public Object getState()(Code)



getTable
Table getTable(String name, Session session) throws SQLException(Code)
Retrieves the specified user defined table or view visible within the context of the specified Session, or any system table of the given name. This excludes any temp tables created in different Sessions.
Parameters:
  name - of the table or view to retrieve
Parameters:
  session - the Session within which to search for user tables the user table or view, or system table
throws:
  SQLException - if there is no such table or view



getTableIndex
int getTableIndex(Table table)(Code)
Retrieves the index of a table or view in the HsqlArrayList that contains these objects for a Database.
Parameters:
  table - the Table object the index of the specified table or view, or -1 if not found



getTables
HsqlArrayList getTables()(Code)
Retrieves a HsqlArrayList containing references to all registered non-system tables and views. This includes all tables and views registered with this Database object via a call to Database.linkTable linkTable . a HsqlArrayList of all registered non-system tables and views



getUserManager
UserManager getUserManager()(Code)
Retrieves the UserManager object for this Database. UserManager object



getUserTable
Table getUserTable(String name, Session session) throws SQLException(Code)
get a user
Parameters:
  name -
Parameters:
  session -
throws:
  SQLException -



getUserTable
Table getUserTable(String name) throws SQLException(Code)



isIgnoreCase
boolean isIgnoreCase()(Code)
isIgnoreCase attribute getter. the value of this Database object's isIgnoreCase attribute



isReferentialIntegrity
boolean isReferentialIntegrity()(Code)
isReferentialIntegrity attribute getter. indicates whether this Database object is currently enforcingreferential integrity



isShutdown
boolean isShutdown()(Code)
isShutdown attribute getter. the value of this Database object's isShutdown attribute



linkTable
void linkTable(Table t) throws SQLException(Code)
Attempts to register the specified table or view with this Database object.
Parameters:
  t - the table of view to register
throws:
  SQLException - if there is a problem



printMessage
String printMessage(Message msg)(Code)
---------------------- End of MembershipListener interface ----------------------- *



processCreateFK
TempConstraint processCreateFK(Tokenizer c, Session session, Table t, HsqlName cname) throws SQLException(Code)



receive
public void receive(Message msg)(Code)
-------------------------- MessageListener interface -------------------------- *



registerSession
void registerSession(Session session)(Code)
Binds the specified Session object into this Database object's active session registry. This method is typically called from Database.connect as the final step, when a successful connection has been made.
Parameters:
  session - the Session object to register



removeExportedKeys
void removeExportedKeys(Table toDrop)(Code)
Removes any foreign key Constraint objects (exported keys) held by any tables referenced by the specified table.

This method is called as the last step of a successful call to in order to ensure that the dropped Table ceases to be referenced when enforcing referential integrity.
Parameters:
  toDrop - The table to which other tables may be holding keys.This is typically a table that is in the process of being dropped.




setReadOnly
void setReadOnly()(Code)
Puts this Database object in global read-only mode. That is, after this call, all existing and future sessions are limited to read-only transactions. Any following attempts to update the state of the database will result in throwing a SQLException.



setReferentialIntegrity
void setReferentialIntegrity(boolean ref)(Code)
isReferentialIntegrity attribute setter.
Parameters:
  ref - if true, this Database object enforces referentialintegrity, else not



setState
public void setState(Object state)(Code)



suspect
public void suspect(Address suspected_mbr)(Code)
Called when a member is suspected



viewAccepted
public void viewAccepted(org.javagroups.View new_view)(Code)
-------------------------- MembershipListener interface -------------------------- *



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.