jet.server.api.db
Interface Database

All Superinterfaces:
DBObject

public interface Database
extends DBObject

Interface Database provides a general proposed database, you can travel all tables in the database.

See Also:
Workspace, Tables, Table

Method Summary
 boolean backup(java.lang.String bkVolume)
          Backups the database into an archive.
 void checkIntegrality(java.util.Map exPathMap)
          Checks the integrity of database.
 boolean cutdownTable(Table tbl, java.lang.String bkVolume, java.lang.String where)
          Cut down data in a table and store those data to an archive.
 Workspace getWorkspace()
          Gets the Workspace of the database in the JReport Server.
 boolean importsTable(Table tbl, java.lang.String bkVolume)
          Imports cut down data from an archive to a table.
 boolean isOpened()
          Tests whether the database is open.
 Tables ProfileTables()
          Gets the profiling database's tables container in the database.
 Tables Realmtables()
          Gets the realm database's tables container in the database.
 boolean restore(java.lang.String bkVolume)
          Restores the database from an archive.
 Tables Systemtables()
          Gets the system database's tables container in the database.
 Tables tables()
          Gets a Tables instance, which is a tables container in this database and all tables of the database are contained in it.
 Table tables(int index)
          Gets the table specified by the index.
 Table tables(java.lang.String tblName)
          Gets the table specified by the table name.
 
Methods inherited from interface jet.server.api.db.DBObject
getName, getProperties, getProperty, getProperty, getUCName, setProperty
 

Method Detail

getWorkspace

Workspace getWorkspace()
Gets the Workspace of the database in the JReport Server.

Returns:
A Workspace instance which is not null.

isOpened

boolean isOpened()
Tests whether the database is open.

Returns:
Return true if the database is open, otherwise return false.

tables

Tables tables()
Gets a Tables instance, which is a tables container in this database and all tables of the database are contained in it.

Returns:
A Tables instance which is not null.
See Also:
Tables

tables

Table tables(int index)
Gets the table specified by the index.

Parameters:
index - The table index, its legal value is arranged from 0 to tables().size() - 1.
Returns:
A Table instance, which is not null.
See Also:
Table

tables

Table tables(java.lang.String tblName)
Gets the table specified by the table name.

Parameters:
tblName - The name of the table, which can not be null.
Returns:
A Table instance if there is a table specified by tblName, otherwise return null.
See Also:
Table

Systemtables

Tables Systemtables()
Gets the system database's tables container in the database.

Returns:
A Tables instance which is a tables container, and all system tables are contained in it.
See Also:
Tables

Realmtables

Tables Realmtables()
Gets the realm database's tables container in the database.

Returns:
A Tables instance which is a tables container, and all realm tables are contained in it.
See Also:
Tables

ProfileTables

Tables ProfileTables()
Gets the profiling database's tables container in the database.

Returns:
A Tables instance which is a tables container, and all profiling tables are contained in it.
See Also:
Tables

backup

boolean backup(java.lang.String bkVolume)
               throws java.sql.SQLException,
                      java.io.IOException
Backups the database into an archive.

Parameters:
bkVolume - The full path name of the archive.
Returns:
Return true if the backup process is successful, otherwise return false.
Throws:
java.sql.SQLException
java.io.IOException

restore

boolean restore(java.lang.String bkVolume)
                throws java.sql.SQLException,
                       java.io.IOException
Restores the database from an archive.

Parameters:
bkVolume - The full path name of the archive.
Returns:
Return true if the restore process is successful, otherwise return false.
Throws:
java.sql.SQLException
java.io.IOException

cutdownTable

boolean cutdownTable(Table tbl,
                     java.lang.String bkVolume,
                     java.lang.String where)
                     throws java.sql.SQLException,
                            java.io.IOException
Cut down data in a table and store those data to an archive. Now, for "realm tables" database, only the result version table "RESULTVERSION_2" can be cut down. And for "profiling" database, only the table "TaskContext" can be cut down.

Parameters:
tbl - The table whose data you want to cut down.
bkVolume - The full path name of the archive where you want to store the cut down data.
where - The sql condition that you cut down data.
Returns:
Return true if the operating is successful, otherwise return false.
Throws:
java.sql.SQLException
java.io.IOException
See Also:
importsTable(jet.server.api.db.Table, java.lang.String)

importsTable

boolean importsTable(Table tbl,
                     java.lang.String bkVolume)
                     throws java.sql.SQLException,
                            java.io.IOException
Imports cut down data from an archive to a table. Now, for "realm tables" database, only the result version table "RESULTVERSION_2" can be cut down, so only the table "RESULTVERSION_2" can be imported. And for "profiling" database, only the table "TaskContext" can be cut down, so only the table "TaskContext" can be imported.

Parameters:
tbl - The table into which you want to import cut down data.
bkVolume - The archive name that you want to import cut down data from it.
Returns:
Return true if the operating is successful, otherwise return false.
Throws:
java.sql.SQLException
java.io.IOException
See Also:
cutdownTable(jet.server.api.db.Table, java.lang.String, java.lang.String)

checkIntegrality

void checkIntegrality(java.util.Map exPathMap)
                      throws java.sql.SQLException
Checks the integrity of database. All invalid data including invalid data in database and invalid external file data will be cleaned up.

Note: User should not invoke this method directly. Please invoke jet.server.api.db.DBManager#checkIntegrality(String dbName).

Parameters:
exPathMap - A files list that stores all relational external files. Here map is used to store file name, and the File object.
Throws:
java.sql.SQLException