|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mckoi.database.control.DBSystem
public final class DBSystem
An object used to access and control a single database system running in the current JVM. This object provides various access methods to safely manipulate the database, as well as allowing server plug-ins. For example, a TCP/IP JDBC server component might be plugged into this object to open the database to remote access.
Method Summary | |
---|---|
void |
close()
Closes this database system so it is no longer able to process queries. |
DBConfig |
getConfig()
Returns an immutable version of the database system configuration. |
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
Makes a connection to the database and returns a java.sql.Connection object that can be used to execute queries on the database. |
java.sql.Connection |
getConnection(java.lang.String schema,
java.lang.String username,
java.lang.String password)
Makes a connection to the database and returns a java.sql.Connection object that can be used to execute queries on the database. |
Database |
getDatabase()
Returns the com.mckoi.database.Database object for this control. |
void |
setDeleteOnClose(boolean status)
Sets a flag that causes the database to delete itself from the file system when it is shut down. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public DBConfig getConfig()
public Database getDatabase()
This object is generally not very useful unless you intend to perform some sort of low level function on the database. This object can be used to bypass the SQL layer and talk directly with the internals of the database.
public java.sql.Connection getConnection(java.lang.String schema, java.lang.String username, java.lang.String password) throws java.sql.SQLException
For example, if this control is for a Mckoi database server, the java.sql.Connection returned here does not go through the TCP/IP connection. For this reason certain database configuration constraints (such as number of concurrent connection on the database) may not apply to this connection.
The java.sql.Connection returned here acts exactly as an object returned by a java.sql.MDriver object.
An SQLException is thrown if the login fails.
schema
- the initial database schema to start the connection in.username
- the user to login to the database under.password
- the password of the user.
java.sql.SQLException
- if authentication of the user fails.public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
For example, if this control is for a Mckoi database server, the java.sql.Connection returned here does not go through the TCP/IP connection. For this reason certain database configuration constraints (such as number of concurrent connection on the database) may not apply to this connection.
The java.sql.Connection returned here acts exactly as an object returned by a java.sql.MDriver object.
An SQLException is thrown if the login fails.
username
- the user to login to the database under.password
- the password of the user.
java.sql.SQLException
- if authentication of the user fails.public final void setDeleteOnClose(boolean status)
By default, a database is not deleted from the file system when it is closed.
NOTE: Use with care - setting this flag will cause all data stored in the database to be lost when the database is shut down.
public void close()
When a database system is closed, it is not able to be restarted again unless a new DBSystem object is obtained from the DBController.
This method also disposes all resources associated with the database system (such as threads, etc) so that it may be reclaimed by the garbage collector.
When this method returns this object is no longer usable.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |