Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jet.server.api.db
Interface Database

All Superinterfaces:
  DBObject

    public interface Database

extends DBObject

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

Method Summary
`boolean` | `backup(java.lang.String bkVolume)` Backup the database to an archive.
`void` | `checkIntegrality(java.util.Map exPathMap)` Check integrality of the database, all invalid data, include invalid data in database and invalid external file data would be clean up.
`boolean` | `cutdownTable(Table tbl, java.lang.String bkVolume, java.lang.String where)` Cut down data in a table and stroe those data to an archive.Now, for "systables" database, only the result version table "RESULTVERSION_2" can be cut down.
`Workspace` | `getWorkspace()` Retrieves the `Workspace` of the database in the JREntServer.
`boolean` | `importsTable(Table tbl, java.lang.String bkVolume)` Imports cut down data from an archive to a table.
`boolean` | `isOpened()` Test whether the database is opened.
`boolean` | `restore(java.lang.String bkVolume)` Restore the database from an archive.
`Tables` | `tables()` Gets the tables container in this database.
`Table` | `tables(int index)` Gets the table that inindicated by an index.
`Table` | `tables(java.lang.String tblName)` Gets the table that inindicated by a table name.

Methods inherited from interface jet.server.api.db.DBObject
`getName, getProperties, getProperty, getProperty, getUCName, setProperty`

Method Detail

### getWorkspace

    Workspace getWorkspace()

  Retrieves the `Workspace` of the database in the JREntServer.

  Returns:
    a `Workspace` instance.

### isOpened

    boolean isOpened()

  Test whether the database is opened.

  Returns:
    true if the database is opened else return false.

### tables

    Tables tables()

  Gets the tables container in this database.

  Returns:
    a `Tables instance, it is a tables container.`
  See Also:
    `Tables`

### tables

    Table tables(int index)

  Gets the table that inindicated by an index.

  Parameters:
    `index` - the sequence number of the table in the container.
  Returns:
    a `Table` instance.
  See Also:
    `Table`

### tables

    Table tables(java.lang.String tblName)

  Gets the table that inindicated by a table name.

  Parameters:
    `tblName` - the name of the table.
  Returns:
    a `Table` instance.
  See Also:
    `Table`

### backup

    boolean backup(java.lang.String bkVolume)
                   throws java.sql.SQLException,
                          java.io.IOException

  Backup the database to an archive.

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

### restore

    boolean restore(java.lang.String bkVolume)
                    throws java.sql.SQLException,
                           java.io.IOException

  Restore the database from an archive.

  Parameters:
    `bkVolume` - the full path name of the archive.
  Returns:
    true if the restore process is successful, else 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 stroe those data to an archive.Now, for "systables" 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 that you want to cut down data.
    `bkVolume` - the full path name of the archive that you want to stroe cut down data in it.
    `where` - the sql conditions that you cut down data.
  Returns:
    true if the operating is successful, else 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 "systables" 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, only the table "TaskContext" can be imported.

  Parameters:
    `tbl` - the table that you want to import cut down data.
    `bkVolume` - the archive name that you want to import cut down data for it.
  Returns:
  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

  Check integrality of the database, all invalid data, include invalid data in database and invalid external file data would be clean 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, we use map to store file name, and the `File` object.
  Throws:
    `java.sql.SQLException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD