# The Java Database Class

Database provides the wrapper for interfacing with eXtremeDB databases.

### For an overview see page Java Classes

### Class Definition

        public class Database implements java.io.Closeable
        {
            /* Public enums */
            public enum TransactionType {…};
            public enum TransactionPriority {…};
            public enum IsolationLevel {…};
            public enum LogType {…};
            public enum IndexType {…};
            public enum EventType {…};
            public enum CommitPolicy {…};
            public enum TransSchedPolicy {…};
            public enum BackupType {…};

            /* Public embedded classes */
            public static class RuntimeInfo{…};
            public static class HAChannelInfo {…};
            public static class ClusterNodeParams {…};
            public static class ClusterNodeInfo {…};
            public static class ClusterWindow	{…};
            public abstract static class ClusterNWParams { };
            public static class ClusterTCPParams extends ClusterNWParams {…};
            public static class ClusterMPIParams extends ClusterNWParams {…};
            public static class ClusterParams {…};
            public static class ClusterInfo {…};
            public static class BackupInfo {…};
            public static class Parameters {…};
            public static class SSLParameters {…};
            public abstract static class Device {…};
            public static class PrivateMemoryDevice extends Device {…};
            public static class SharedMemoryDevice extends Device {…};
            public static class FileDevice extends Device {…};
            public static class MultiFileDevice extends FileDevice {…};
            public static class RaidDevice extends FileDevice {…};

            /* Constructors */
            public Database() {…}
            public Database(int config) {…};
            public Database(Database db) {…};

            /* System Time */
            public interface GetCurrentTimeCallback {…};
            public static void setCurrentTimeCallback(GetCurrentTimeCallback callback ) {…};

            /* Runtime Options */
            public static void setRuntimeOption(int option, int value) {…};
            public static int  getRuntimeOption(int option) {…};

            /* Database methods */
            public void open(String name, Parameters params, Device[] devices) {…};
            public void open(String name, Parameters params, long size) {…};

            public Connection connect() {…};
            public Connection connect(byte [] context) {…};
            public Connection connect(String name) {…};
            public Connection connect(String name, byte[] context) {…};

            public SqlLocalConnection connectSql() {…};

            public void extend(Device device) {…};
            public void extend(Device device, byte [] context) {…};

            public boolean detach(Device device) {…};
            public boolean detach(Device device, byte [] context) {…};

            public void close() {…};

            public RuntimeInfo getRunTimeInfo() {…};

            public void generateMcoFile(String path) throws IOException {…};

            /* Cluster */
            public interface ClusterQuorumCallback {…};
            public interface ClusterNotifying {…};
        }

## Public Interface

`enums` | Enumerated Database constants
`constants` | Database constant values
`embedded classes` | Public embedded Database classes
Constructors
`public Database()` | Default constructor
`public Database(int config)` | Constructor accepting a bitmap argument consisting of Runtime Configuration options (``MCO_CFG_*`` ) flags
`public Database(Database db)` | Copy constructor
System Time Methods
`public interface GetCurrentTimeCallback()` | The prototype for a system time callback function
`public static void setCurrentTimeCallback(GetCurrentTimeCallback callback )` | Calls the specified system time callback function to set the current time
Runtime Options Methods
`public static void setRuntimeOption(int option, int value)` | Set the specified runtime option
`public static int getRuntimeOption(int option)` | Retrieve the specified runtime option
Database Methods
`public void open(String name, Parameters params, long size)` | Open an eXtremeDB database with the specified name, parameters and size
`public void open(String name, Parameters params, Device[] devices)` | Open an eXtremeDB database with the specified parameters and device(s)
`public Connection connect()` | Connect to an eXtremeDB database
`public Connection connect(byte [] context)` | Connect to an eXtremeDB database with a specified context
`public Connection connect(String name)` | Connect to an eXtremeDB database by name
`public Connection connect(String name, byte[] context)` | Connect to an eXtremeDB database by name with a specified context
`public SqlLocalConnection connectSql()` | Create a local SQL connection
`public void extend(Device device)` | Extend database memory
`public void extend(Device device, byte [] context)` | Extend database memory with a specified context
`public boolean detach(Device device)` | Detach a memory device
`public boolean detach(Device device, byte [] context)` | Detach a memory device with the specified context
`public void close()` | Close the database
`public RuntimeInfo getRunTimeInfo()` | Retrieve eXtremeDB runtime settings
`public void generateMcoFile(String path)` | Generate a schema definition file
Cluster Methods
`public interface ClusterQuorumCallback` | Callback prototype for Quorum notification
`public interface ClusterNotifying` | Callback prototype for event notification