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

DatabaseManager
public class DatabaseManager (Code)
Handles initial attempts to connect to HSQLDB databases within the JVM (or a classloader within the JVM). Opens the database if it is not open or connects to it if it is already open. This allows the same database to be used by different instances of Server and by direct connections.

Maintains a map of Server instances and notifies each server when its database has shut down.

Maintains a reference to the timer used for file locks and logging.


author:
   fredt@users
version:
   1.8.0
since:
   1.7.2



Field Summary
final static  IntKeyHashMapdatabaseIDMap
    
final static  HashMapfileDatabaseMap
    
final static  HashMapmemDatabaseMap
    
final static  HashMapresDatabaseMap
    
static  HashMapserverMap
     Maintains a map of servers to sets of databases.


Method Summary
public static  voidcloseDatabases(int mode)
    
static  voiddeRegisterServer(Server server)
     Deregisters a server completely.
static  intgetDatabase(String type, String path, Server server, HsqlProperties props)
    
static  DatabasegetDatabase(String type, String path, HsqlProperties props)
     This has to be improved once a threading model is in place. Current behaviour: Attempts to connect to different databases do not block.
public static  VectorgetDatabaseURIs()
     Returns a vector containing the URI (type + path) for all the databases.
static  SessiongetSession(int dbId, int sessionId)
     Returns an existing session.
public static  HsqlTimergetTimer()
    
static  booleanisServerDB(Database db)
    
static  SessionnewSession(int dbID, String user, String password)
    
public static  SessionnewSession(String type, String path, String user, String password, HsqlProperties props)
    
static  voidremoveDatabase(Database database)
     Removes the database from registry.

Field Detail
databaseIDMap
final static IntKeyHashMap databaseIDMap(Code)
id number to Database for Databases currently in registry



fileDatabaseMap
final static HashMap fileDatabaseMap(Code)
File to Database mapping for file: databases



memDatabaseMap
final static HashMap memDatabaseMap(Code)
name to Database mapping for mem: databases



resDatabaseMap
final static HashMap resDatabaseMap(Code)
File to Database mapping for res: databases



serverMap
static HashMap serverMap(Code)
Maintains a map of servers to sets of databases. Servers register each of their databases. When a database is shutdown, all the servers accessing it are notified. The database is then removed form the sets for all servers and the servers that have no other database are removed from the map.





Method Detail
closeDatabases
public static void closeDatabases(int mode)(Code)
Closes all the databases using the given mode.

CLOSEMODE_IMMEDIATELY = -1; CLOSEMODE_NORMAL = 0; CLOSEMODE_COMPACT = 1; CLOSEMODE_SCRIPT = 2;




deRegisterServer
static void deRegisterServer(Server server)(Code)
Deregisters a server completely.



getDatabase
static int getDatabase(String type, String path, Server server, HsqlProperties props) throws HsqlException(Code)
Used by server to open or create a database



getDatabase
static Database getDatabase(String type, String path, HsqlProperties props) throws HsqlException(Code)
This has to be improved once a threading model is in place. Current behaviour: Attempts to connect to different databases do not block. Two db's can open simultaneously. Attempts to connect to a db while it is opening or closing will block until the db is open or closed. At this point the db state is either DATABASE_ONLINE (after db.open() has returned) which allows a new connection to be made, or the state is DATABASE_SHUTDOWN which means the db can be reopened for the new connection).



getDatabaseURIs
public static Vector getDatabaseURIs()(Code)
Returns a vector containing the URI (type + path) for all the databases.



getSession
static Session getSession(int dbId, int sessionId)(Code)
Returns an existing session. Used with repeat HTTP connections belonging to the same JDBC Conenction / HSQL Session pair.



getTimer
public static HsqlTimer getTimer()(Code)



isServerDB
static boolean isServerDB(Database db)(Code)



newSession
static Session newSession(int dbID, String user, String password) throws HsqlException(Code)
Used by server to open a new session



newSession
public static Session newSession(String type, String path, String user, String password, HsqlProperties props) throws HsqlException(Code)
Used by in-process connections and by Servlet



removeDatabase
static void removeDatabase(Database database)(Code)
Removes the database from registry.



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.