Db.java
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:25k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. /*-
  2.  * See the file LICENSE for redistribution information.
  3.  *
  4.  * Copyright (c) 1997, 1998, 1999, 2000
  5.  * Sleepycat Software.  All rights reserved.
  6.  *
  7.  * $Id: Db.java,v 11.38 2000/12/31 19:26:22 bostic Exp $
  8.  */
  9. package com.sleepycat.db;
  10. import java.io.OutputStream;
  11. import java.io.FileNotFoundException;
  12. /**
  13.  *
  14.  * @author Donald D. Anderson
  15.  */
  16. public class Db
  17. {
  18.     // All constant and flag values used with Db* classes are defined here.
  19.     // Collectively, these constants are known by the name
  20.     // "DBTYPE" in the documentation.
  21.     //
  22.     public static final int DB_BTREE = 1; // B+tree
  23.     public static final int DB_HASH  = 2; // Extended Linear Hashing.
  24.     public static final int DB_RECNO = 3; // Fixed and variable-length records.
  25.     public static final int DB_QUEUE = 4; // Queue
  26.     public static final int DB_UNKNOWN = 5; // Figure it out on open.
  27.     // Flags understood by DbEnv()
  28.     //
  29.     // Note: DB_CXX_NO_EXCEPTIONS will have no effect in Java.
  30.     //
  31.     public static final int DB_CXX_NO_EXCEPTIONS; // C++: return error values
  32.     public static final int DB_CLIENT;    // Open for a client environment.
  33.     // Flags understood by Db()
  34.     //
  35.     public static final int DB_XA_CREATE;  // Open in an XA environment.
  36.     // Flags understood by Db.open(), DbEnv.open().
  37.     //
  38.     public static final int DB_CREATE; // O_CREAT: create file as necessary.
  39.     public static final int DB_NOMMAP; // Don't mmap underlying file.
  40.     public static final int DB_THREAD; // Free-thread DB package handles.
  41.     // Flags understood by only DbEnv.open().
  42.     //
  43.     public static final int DB_LOCKDOWN; // Lock memory into physical core.
  44.     public static final int DB_PRIVATE;  // DB_ENV is process local.
  45.     //
  46.     // Flags understood by DbEnv.txn_begin().
  47.     //
  48.     public static final int DB_TXN_NOWAIT; // Do not wait for locks in this TXN.
  49.     public static final int DB_TXN_SYNC;   // Always sync log on commit.
  50.     // Flags understood by DbEnv.set_flags().
  51.     //
  52.     public static final int DB_CDB_ALLDB;  // In CDB, lock across environment.
  53.     //
  54.     // Flags understood by Db.open().
  55.     //
  56.     public static final int DB_EXCL;     // Exclusive open (O_EXCL).
  57.     public static final int DB_RDONLY;   // Read-only (O_RDONLY).
  58.     public static final int DB_TRUNCATE; // Discard existing DB.
  59.     public static final int DB_UPGRADE;  // Upgrade if necessary.
  60.     //
  61.     // DB (user visible) error return codes.
  62.     //
  63.     public static final int DB_INCOMPLETE = -30999; // Sync didn't finish.
  64.     public static final int DB_KEYEMPTY = -30998;   // The key/data pair was deleted or
  65.                                                 // was never created by the user.
  66.     public static final int DB_KEYEXIST = -30997;   // The key/data pair already exists.
  67.     public static final int DB_LOCK_DEADLOCK = -30996; // Locker killed to resolve deadlock.
  68.     public static final int DB_LOCK_NOTGRANTED = -30995; // Lock unavailable, no-wait set.
  69.     public static final int DB_NOSERVER = -30994;   // Server panic return.
  70.     public static final int DB_NOSERVER_HOME = -30993;   // Bad home sent to server.
  71.     public static final int DB_NOSERVER_ID = -30992;   // Bad ID sent to server.
  72.     public static final int DB_NOTFOUND = -30991;      // Key/data pair not found (EOF).
  73.     public static final int DB_OLD_VERSION = -30990;   // Out-of-date version.
  74.     public static final int DB_RUNRECOVERY = -30989;   // Panic return.
  75.     public static final int DB_VERIFY_BAD = -30988;    // Verify failed; bad format.
  76.     //
  77.     // Flags used by DbEnv.open and DbEnv.remove.
  78.     //
  79.     public static final int DB_FORCE;            // Force (anything).
  80.     public static final int DB_INIT_CDB;         // Concurrent Access Methods.
  81.     public static final int DB_INIT_LOCK;        // Initialize locking.
  82.     public static final int DB_INIT_LOG;         // Initialize logging.
  83.     public static final int DB_INIT_MPOOL;       // Initialize mpool.
  84.     public static final int DB_INIT_TXN;         // Initialize transactions.
  85.     public static final int DB_JOINENV;          // Initialize all subsystems present.
  86.     public static final int DB_RECOVER;          // Run normal recovery.
  87.     public static final int DB_RECOVER_FATAL;    // Run catastrophic recovery.
  88.     public static final int DB_SYSTEM_MEM;       // Use system-backed memory.
  89.     public static final int DB_TXN_NOSYNC;       // Do not sync log on commit.
  90.     public static final int DB_USE_ENVIRON;      // Use the environment.
  91.     public static final int DB_USE_ENVIRON_ROOT; // Use the environment if root.
  92.     //
  93.     // Operations values to the tx_recover() function.
  94.     //
  95.     public static final int DB_TXN_BACKWARD_ROLL = 1;
  96.     public static final int DB_TXN_FORWARD_ROLL = 2;
  97.     public static final int DB_TXN_OPENFILES = 3;
  98.     public static final int DB_TXN_REDO = 4;
  99.     public static final int DB_TXN_UNDO = 5;
  100.     //
  101.     // Verbose flags; used for DbEnv.set_verbose
  102.     //
  103.     public static final int DB_VERB_CHKPOINT;  // List checkpoints.
  104.     public static final int DB_VERB_DEADLOCK;  // Deadlock detection information.
  105.     public static final int DB_VERB_RECOVERY;  // Recovery information.
  106.     public static final int DB_VERB_WAITSFOR;  // Dump waits-for table.
  107.     //
  108.     // Deadlock detector modes; used in the DBENV structure to configure the
  109.     // locking subsystem.
  110.     //
  111.     public static final int DB_LOCK_NORUN;
  112.     public static final int DB_LOCK_DEFAULT;
  113.     public static final int DB_LOCK_OLDEST;
  114.     public static final int DB_LOCK_RANDOM;
  115.     public static final int DB_LOCK_YOUNGEST;
  116.     //
  117.     // Flags understood by only Db.set_flags.
  118.     //
  119.     public static final int DB_DUP;        // Btree, Hash: duplicate keys.
  120.     public static final int DB_DUPSORT;    // Btree, Hash: duplicate keys.
  121.     public static final int DB_RECNUM;     // Btree: record numbers.
  122.     public static final int DB_RENUMBER;   // Recno: renumber on insert/delete.
  123.     public static final int DB_REVSPLITOFF;// Btree: turn off reverse splits.
  124.     public static final int DB_SNAPSHOT;   // Recno: snapshot the input.
  125.     //
  126.     // Flags understood by only Db.join
  127.     //
  128.     public static final int DB_JOIN_NOSORT;// Don't try to optimize join.
  129.     //
  130.     // Flags understood by only Db.verify
  131.     //
  132.     public static final int DB_NOORDERCHK;  // Skip order check; subdb w/ user func
  133.     public static final int DB_ORDERCHKONLY;// Only perform an order check on subdb
  134.     public static final int DB_SALVAGE;     // Salvage what looks like data.
  135.     public static final int DB_AGGRESSIVE;  // Salvage anything which might be data.
  136.     // Collectively, these constants are known by the name
  137.     // "db_lockmode_t" in the documentation.
  138.     //
  139.     public static final int DB_LOCK_NG = 0; // Not granted.
  140.     public static final int DB_LOCK_READ = 1; // Shared/read.
  141.     public static final int DB_LOCK_WRITE = 2; // Exclusive/write.
  142.     public static final int DB_LOCK_IWRITE = 3; // Intent exclusive/write.
  143.     public static final int DB_LOCK_IREAD = 4; // Intent to share/read.
  144.     public static final int DB_LOCK_IWR = 5; // Intent to read and write.
  145.     // Collectively, these constants are known by the name
  146.     // "db_lockop_t" in the documentation.
  147.     //
  148.     public static final int DB_LOCK_DUMP = 0; // Display held locks.
  149.     public static final int DB_LOCK_GET = 1; // Get the lock.
  150.     /* Not visible to API:  DB_LOCK_INHERIT = 2 // Pass locks to parent. */
  151.     public static final int DB_LOCK_PUT = 3; // Release the lock.
  152.     public static final int DB_LOCK_PUT_ALL = 4;// Release locker's locks.
  153.     public static final int DB_LOCK_PUT_OBJ = 5;// Release locker's locks on obj.
  154.     // Flag values for DbLock.vec()
  155.     public static final int DB_LOCK_NOWAIT; // Don't wait on unavailable lock.
  156.     // Flag values for DbLock.detect()
  157.     public static final int DB_LOCK_CONFLICT; // Run on any conflict.
  158.     //
  159.     // Flag values for DbLog.archive()
  160.     //
  161.     public static final int DB_ARCH_ABS;      // Absolute pathnames.
  162.     public static final int DB_ARCH_DATA;     // Data files.
  163.     public static final int DB_ARCH_LOG;      // Log files.
  164.     //
  165.     // DB access method and cursor operation values.
  166.     // Each value is an operation code to which
  167.     // additional bit flags are added.
  168.     //
  169.     public static final int DB_AFTER;      // Dbc.put()
  170.     public static final int DB_APPEND;     // Db.put()
  171.     public static final int DB_BEFORE;     // Dbc.put()
  172.     public static final int DB_CACHED_COUNTS; // Db.stat()
  173.     public static final int DB_CHECKPOINT; // DbLog.put(), DbLog.get()
  174.     public static final int DB_CONSUME;    // Db.get()
  175.     public static final int DB_CONSUME_WAIT; // Db.get()
  176.     public static final int DB_CURLSN;     // DbLog.put()
  177.     public static final int DB_CURRENT;    // Dbc.get(), Dbc.put(), DbLog.get()
  178.     public static final int DB_FIRST;      // Dbc.get(), DbLog.get()
  179.     public static final int DB_FLUSH;      // DbLog.put()
  180.     public static final int DB_GET_BOTH;   // Db.get(), Dbc.get()
  181.     public static final int DB_GET_RECNO;  // Dbc.get()
  182.     public static final int DB_JOIN_ITEM;  // Dbc.get()
  183.     public static final int DB_KEYFIRST;   // Dbc.put()
  184.     public static final int DB_KEYLAST;    // Dbc.put()
  185.     public static final int DB_LAST;       // Dbc.get(), DbLog.get()
  186.     public static final int DB_NEXT;       // Dbc.get(), DbLog.get()
  187.     public static final int DB_NEXT_DUP;   // Dbc.get()
  188.     public static final int DB_NEXT_NODUP; // Dbc.get()
  189.     public static final int DB_NODUPDATA;  // Don't permit duplicated data
  190.     public static final int DB_NOOVERWRITE;// Db.put()
  191.     public static final int DB_NOSYNC;     // Db.close()
  192.     public static final int DB_POSITION;   // Dbc.dup()
  193.     public static final int DB_PREV;       // Dbc.get(), DbLog.get()
  194.     public static final int DB_PREV_NODUP; // Dbc.get()
  195.     public static final int DB_RECORDCOUNT;// Db.stat()
  196.     public static final int DB_SET;        // Dbc.get(), DbLog.get()
  197.     public static final int DB_SET_RANGE;  // Dbc.get()
  198.     public static final int DB_SET_RECNO;  // Dbc.get()
  199.     public static final int DB_WRITECURSOR;// Db.cursor()
  200.     // Other flags that can be added to an operation codes above.
  201.     //
  202.     public static final int DB_RMW;        // Acquire write flag immediately.
  203.     // Collectively, these values are used for Dbt flags
  204.     //
  205.     // Return in allocated memory.
  206.     public static final int DB_DBT_MALLOC;
  207.     // Partial put/get.
  208.     public static final int DB_DBT_PARTIAL;
  209.     // Return in realloc'd memory.
  210.     public static final int DB_DBT_REALLOC;
  211.     // Return in user's memory.
  212.     public static final int DB_DBT_USERMEM;
  213.     // Note: the env can be null
  214.     //
  215.     public Db(DbEnv env, int flags)
  216.         throws DbException
  217.     {
  218.         constructor_env_ = env;
  219.         _init(env, flags);
  220.         if (env == null) {
  221.             dbenv_ = new DbEnv(this);
  222.         }
  223.         else {
  224.             dbenv_ = env;
  225.         }
  226.         dbenv_._add_db(this);
  227.     }
  228.     //
  229.     // Our parent DbEnv is notifying us that the environment is closing.
  230.     //
  231.     /*package*/ void _notify_dbenv_close()
  232.     {
  233.         dbenv_ = null;
  234.         _notify_internal();
  235.     }
  236.     
  237.     private native void _init(DbEnv env, int flags)
  238.          throws DbException;
  239.     private native void _notify_internal();
  240.     // methods
  241.     //
  242.     public synchronized int close(int flags)
  243.         throws DbException
  244.     {
  245.         int err;
  246.         
  247.         dbenv_._remove_db(this);
  248.         err = _close(flags);
  249.         if (constructor_env_ == null) {
  250.             dbenv_._notify_db_close();
  251.         }
  252.         return err;
  253.     }
  254.     public native int _close(int flags)
  255.          throws DbException;
  256.     public native Dbc cursor(DbTxn txnid, int flags)
  257.          throws DbException;
  258.     public native int del(DbTxn txnid, Dbt key, int flags)
  259.          throws DbException;
  260.     public native void err(int errcode, String message);
  261.     public native void errx(String message);
  262.     public native int fd()
  263.          throws DbException;
  264.     // overrides Object.finalize
  265.     protected void finalize()
  266.         throws Throwable
  267.     {
  268.         _finalize(dbenv_.errcall_, dbenv_.errpfx_);
  269.     }
  270.     protected native void _finalize(DbErrcall errcall, String errpfx)
  271.         throws Throwable;
  272.     // returns: 0, DB_NOTFOUND, or throws error
  273.     public native int get(DbTxn txnid, Dbt key, Dbt data, int flags)
  274.          throws DbException;
  275.     public native boolean get_byteswapped();
  276.     public native /*DBTYPE*/ int get_type();
  277.     public native Dbc join(Dbc curslist[], int flags)
  278.          throws DbException;
  279.     public native void key_range(DbTxn txn, Dbt key,
  280.                                  DbKeyRange range, int flags)
  281.          throws DbException;
  282.     public synchronized void open(String file, String database,
  283.                      /*DBTYPE*/ int type,
  284.                      int flags, int mode)
  285.          throws DbException, FileNotFoundException
  286.     {
  287.         _open(file, database, type, flags, mode);
  288.     }
  289.         
  290.     // (Internal)
  291.     public native void _open(String file, String database,
  292.                             /*DBTYPE*/ int type,
  293.                             int flags, int mode)
  294.          throws DbException, FileNotFoundException;
  295.         
  296.     // returns: 0, DB_KEYEXIST, or throws error
  297.     public native int put(DbTxn txnid, Dbt key, Dbt data, int flags)
  298.          throws DbException;
  299.     public synchronized native void rename(String file, String database,
  300.                                            String newname, int flags)
  301.          throws DbException, FileNotFoundException;
  302.     public synchronized native void remove(String file, String database,
  303.                                            int flags)
  304.          throws DbException, FileNotFoundException;
  305.     // Comparison function.
  306.     public void set_append_recno(DbAppendRecno append_recno)
  307.         throws DbException
  308.     {
  309.         append_recno_ = append_recno;
  310.         append_recno_changed(append_recno);
  311.     }
  312.     // (Internal)
  313.     private native void append_recno_changed(DbAppendRecno append_recno)
  314.         throws DbException;
  315.     // Comparison function.
  316.     public void set_bt_compare(DbBtreeCompare bt_compare)
  317.         throws DbException
  318.     {
  319.         bt_compare_ = bt_compare;
  320.         bt_compare_changed(bt_compare);
  321.     }
  322.     // (Internal)
  323.     private native void bt_compare_changed(DbBtreeCompare bt_compare)
  324.         throws DbException;
  325.     // Maximum keys per page.
  326.     public native void set_bt_maxkey(int maxkey)
  327.         throws DbException;
  328.     // Minimum keys per page.
  329.     public native void set_bt_minkey(int minkey)
  330.         throws DbException;
  331.     // Prefix function.
  332.     public void set_bt_prefix(DbBtreePrefix bt_prefix)
  333.         throws DbException
  334.     {
  335.         bt_prefix_ = bt_prefix;
  336.         bt_prefix_changed(bt_prefix);
  337.     }
  338.     
  339.     // (Internal)
  340.     private native void bt_prefix_changed(DbBtreePrefix bt_prefix)
  341.         throws DbException;
  342.     // Set cache size
  343.     public native void set_cachesize(int gbytes, int bytes, int ncaches)
  344.         throws DbException;
  345.     // Duplication resolution
  346.     public void set_dup_compare(DbDupCompare dup_compare)
  347.         throws DbException
  348.     {
  349.         dup_compare_ = dup_compare;
  350.         dup_compare_changed(dup_compare);
  351.     }
  352.     // (Internal)
  353.     private native void dup_compare_changed(DbDupCompare dup_compare)
  354.         throws DbException;
  355.     // Error message callback.
  356.     public void set_errcall(DbErrcall errcall)
  357.     {
  358.         if (dbenv_ != null)
  359.             dbenv_.set_errcall(errcall);
  360.     }
  361.     // Error stream.
  362.     public void set_error_stream(OutputStream s)
  363.     {
  364.         DbOutputStreamErrcall errcall = new DbOutputStreamErrcall(s);
  365.         set_errcall(errcall);
  366.     }
  367.     // Error message prefix.
  368.     public void set_errpfx(String errpfx)
  369.     {
  370.         if (dbenv_ != null)
  371.             dbenv_.set_errpfx(errpfx);
  372.     }
  373.     
  374.     // Feedback
  375.     public void set_feedback(DbFeedback feedback)
  376.         throws DbException
  377.     {
  378.         feedback_ = feedback;
  379.         feedback_changed(feedback);
  380.     }
  381.     // (Internal)
  382.     private native void feedback_changed(DbFeedback feedback)
  383.         throws DbException;
  384.     // Flags.
  385.     public native void set_flags(/*u_int32_t*/ int flags);
  386.     // Fill factor.
  387.     public native void set_h_ffactor(/*unsigned*/ int h_ffactor);
  388.     // Hash function.
  389.     public void set_h_hash(DbHash h_hash)
  390.         throws DbException
  391.     {
  392.         h_hash_ = h_hash;
  393.         hash_changed(h_hash);
  394.     }
  395.     // (Internal)
  396.     private native void hash_changed(DbHash hash)        
  397.         throws DbException;
  398.     // Number of elements.
  399.     public native void set_h_nelem(/*unsigned*/ int h_nelem);
  400.     // Byte order.
  401.     public native void set_lorder(int lorder);
  402.     // Underlying page size.
  403.     public native void set_pagesize(/*size_t*/ long pagesize);
  404.     // Variable-length delimiting byte.
  405.     public native void set_re_delim(int re_delim);
  406.     // Length for fixed-length records.
  407.     public native void set_re_len(/*u_int32_t*/ int re_len);
  408.     // Fixed-length padding byte.
  409.     public native void set_re_pad(int re_pad);
  410.     // Source file name.
  411.     public native void set_re_source(String re_source);
  412.     // Extent size of Queue
  413.     public native void set_q_extentsize(/*u_int32_t*/ int extent_size);
  414.     // returns a DbBtreeStat or DbHashStat
  415.     public native Object stat(int flags)
  416.          throws DbException;
  417.     public native int sync(int flags)
  418.          throws DbException;
  419.     public native void upgrade(String name, int flags)
  420.          throws DbException;
  421.     public native void verify(String name, String subdb,
  422.                               OutputStream outstr, int flags)
  423.          throws DbException;
  424.     ////////////////////////////////////////////////////////////////
  425.     //
  426.     // private data
  427.     //
  428.     private long private_dbobj_ = 0;
  429.     private long private_info_ = 0;
  430.     private DbEnv dbenv_ = null;
  431.     private DbEnv constructor_env_ = null;
  432.     private DbFeedback feedback_ = null;
  433.     private DbAppendRecno append_recno_ = null;
  434.     private DbBtreeCompare bt_compare_ = null;
  435.     private DbBtreePrefix bt_prefix_ = null;
  436.     private DbDupCompare dup_compare_ = null;
  437.     private DbHash h_hash_ = null;
  438.     ////////////////////////////////////////////////////////////////
  439.     //
  440.     // static methods and data that implement
  441.     // loading the native library and doing any
  442.     // extra sanity checks on startup.
  443.     //
  444.     private static boolean already_loaded_ = false;
  445.     public static void load_db()
  446.     {
  447.         if (already_loaded_)
  448.             return;
  449.         // An alternate library name can be specified via a property.
  450.         //
  451.         String overrideLibname = System.getProperty("sleepycat.db.libname");
  452.         if (overrideLibname != null) {
  453.             System.loadLibrary(overrideLibname);
  454.         }
  455.         else {
  456.             String os = System.getProperty("os.name");
  457.             if (os != null && os.startsWith("Windows")) {
  458.                 // library name is "libdb_java30.dll" (for example) on Win/*
  459.                 System.loadLibrary("libdb_java" +
  460.                                    DbConstants.DB_VERSION_MAJOR +
  461.                                    DbConstants.DB_VERSION_MINOR);
  462.             }
  463.             else {
  464.                 // library name is "libdb_java-3.0.so" (for example) on UNIX
  465.                 // Note: "db_java" isn't good enough;
  466.                 // some Unixes require us to use the explicit SONAME.
  467.                 System.loadLibrary("db_java-" +
  468.                                    DbConstants.DB_VERSION_MAJOR + "." +
  469.                                    DbConstants.DB_VERSION_MINOR);
  470.             }
  471.         }
  472.         already_loaded_ = true;
  473.     }
  474.     static private native void one_time_init();
  475.     static private void check_constant(int c1, int c2)
  476.     {
  477.         if (c1 != c2) {
  478.             System.err.println("Db: constant mismatch");
  479.             System.exit(1);
  480.         }
  481.     }
  482.     static {
  483.         Db.load_db();
  484.         // Note: constant values are stored in DbConstants, which
  485.         // is automatically generated.  Initializing constants in
  486.         // static code insulates users from the possibility of
  487.         // changing constants.
  488.         //
  489.         DB_CXX_NO_EXCEPTIONS = DbConstants.DB_CXX_NO_EXCEPTIONS;
  490.         DB_CLIENT = DbConstants.DB_CLIENT;
  491.         DB_XA_CREATE = DbConstants.DB_XA_CREATE;
  492.         DB_CREATE = DbConstants.DB_CREATE;
  493.         DB_NOMMAP = DbConstants.DB_NOMMAP;
  494.         DB_THREAD = DbConstants.DB_THREAD;
  495.         DB_LOCKDOWN = DbConstants.DB_LOCKDOWN;
  496.         DB_PRIVATE = DbConstants.DB_PRIVATE;
  497.         DB_TXN_NOWAIT = DbConstants.DB_TXN_NOWAIT;
  498.         DB_TXN_SYNC = DbConstants.DB_TXN_SYNC;
  499.         DB_CDB_ALLDB = DbConstants.DB_CDB_ALLDB;
  500.         DB_EXCL = DbConstants.DB_EXCL;
  501.         DB_RDONLY = DbConstants.DB_RDONLY;
  502.         DB_TRUNCATE = DbConstants.DB_TRUNCATE;
  503.         DB_UPGRADE = DbConstants.DB_UPGRADE;
  504.         // These constants are not assigned, but rather checked.
  505.         // Having initialized constants for these values allows
  506.         // them to be used as case values in switch statements.
  507.         //
  508.         check_constant(DB_INCOMPLETE, DbConstants.DB_INCOMPLETE);
  509.         check_constant(DB_KEYEMPTY, DbConstants.DB_KEYEMPTY);
  510.         check_constant(DB_KEYEXIST, DbConstants.DB_KEYEXIST);
  511.         check_constant(DB_LOCK_DEADLOCK, DbConstants.DB_LOCK_DEADLOCK);
  512.         check_constant(DB_LOCK_NOTGRANTED, DbConstants.DB_LOCK_NOTGRANTED);
  513.         check_constant(DB_NOSERVER, DbConstants.DB_NOSERVER);
  514.         check_constant(DB_NOSERVER_HOME, DbConstants.DB_NOSERVER_HOME);
  515.         check_constant(DB_NOSERVER_ID, DbConstants.DB_NOSERVER_ID);
  516.         check_constant(DB_NOTFOUND, DbConstants.DB_NOTFOUND);
  517.         check_constant(DB_OLD_VERSION, DbConstants.DB_OLD_VERSION);
  518.         check_constant(DB_RUNRECOVERY, DbConstants.DB_RUNRECOVERY);
  519.         check_constant(DB_VERIFY_BAD, DbConstants.DB_VERIFY_BAD);
  520.         check_constant(DB_TXN_BACKWARD_ROLL, DbConstants.DB_TXN_BACKWARD_ROLL);
  521.         check_constant(DB_TXN_FORWARD_ROLL, DbConstants.DB_TXN_FORWARD_ROLL);
  522.         check_constant(DB_TXN_OPENFILES, DbConstants.DB_TXN_OPENFILES);
  523.         check_constant(DB_TXN_REDO, DbConstants.DB_TXN_REDO);
  524.         check_constant(DB_TXN_UNDO, DbConstants.DB_TXN_UNDO);
  525.         DB_FORCE = DbConstants.DB_FORCE;
  526.         DB_INIT_CDB = DbConstants.DB_INIT_CDB;
  527.         DB_INIT_LOCK = DbConstants.DB_INIT_LOCK;
  528.         DB_INIT_LOG = DbConstants.DB_INIT_LOG;
  529.         DB_INIT_MPOOL = DbConstants.DB_INIT_MPOOL;
  530.         DB_INIT_TXN = DbConstants.DB_INIT_TXN;
  531.         DB_JOINENV = DbConstants.DB_JOINENV;
  532.         DB_RECOVER = DbConstants.DB_RECOVER;
  533.         DB_RECOVER_FATAL = DbConstants.DB_RECOVER_FATAL;
  534.         DB_SYSTEM_MEM = DbConstants.DB_SYSTEM_MEM;
  535.         DB_TXN_NOSYNC = DbConstants.DB_TXN_NOSYNC;
  536.         DB_USE_ENVIRON = DbConstants.DB_USE_ENVIRON;
  537.         DB_USE_ENVIRON_ROOT = DbConstants.DB_USE_ENVIRON_ROOT;
  538.         DB_VERB_CHKPOINT = DbConstants.DB_VERB_CHKPOINT;
  539.         DB_VERB_DEADLOCK = DbConstants.DB_VERB_DEADLOCK;
  540.         DB_VERB_RECOVERY = DbConstants.DB_VERB_RECOVERY;
  541.         DB_VERB_WAITSFOR = DbConstants.DB_VERB_WAITSFOR;
  542.         DB_LOCK_NORUN = DbConstants.DB_LOCK_NORUN;
  543.         DB_LOCK_DEFAULT = DbConstants.DB_LOCK_DEFAULT;
  544.         DB_LOCK_OLDEST = DbConstants.DB_LOCK_OLDEST;
  545.         DB_LOCK_RANDOM = DbConstants.DB_LOCK_RANDOM;
  546.         DB_LOCK_YOUNGEST = DbConstants.DB_LOCK_YOUNGEST;
  547.         DB_DUP = DbConstants.DB_DUP;
  548.         DB_DUPSORT = DbConstants.DB_DUPSORT;
  549.         DB_RECNUM = DbConstants.DB_RECNUM;
  550.         DB_RENUMBER = DbConstants.DB_RENUMBER;
  551.         DB_REVSPLITOFF = DbConstants.DB_REVSPLITOFF;
  552.         DB_SNAPSHOT = DbConstants.DB_SNAPSHOT;
  553.         DB_JOIN_NOSORT = DbConstants.DB_JOIN_NOSORT;
  554.         DB_NOORDERCHK = DbConstants.DB_NOORDERCHK;
  555.         DB_ORDERCHKONLY = DbConstants.DB_ORDERCHKONLY;
  556.         DB_SALVAGE = DbConstants.DB_SALVAGE;
  557.         DB_AGGRESSIVE = DbConstants.DB_AGGRESSIVE;
  558.         DB_LOCK_NOWAIT = DbConstants.DB_LOCK_NOWAIT;
  559.         DB_LOCK_CONFLICT = DbConstants.DB_LOCK_CONFLICT;
  560.         DB_ARCH_ABS = DbConstants.DB_ARCH_ABS;
  561.         DB_ARCH_DATA = DbConstants.DB_ARCH_DATA;
  562.         DB_ARCH_LOG = DbConstants.DB_ARCH_LOG;
  563.         DB_AFTER = DbConstants.DB_AFTER;
  564.         DB_APPEND = DbConstants.DB_APPEND;
  565.         DB_BEFORE = DbConstants.DB_BEFORE;
  566.         DB_CACHED_COUNTS = DbConstants.DB_CACHED_COUNTS;
  567.         DB_CHECKPOINT = DbConstants.DB_CHECKPOINT;
  568.         DB_CONSUME = DbConstants.DB_CONSUME;
  569.         DB_CONSUME_WAIT = DbConstants.DB_CONSUME_WAIT;
  570.         DB_CURLSN = DbConstants.DB_CURLSN;
  571.         DB_CURRENT = DbConstants.DB_CURRENT;
  572.         DB_FIRST = DbConstants.DB_FIRST;
  573.         DB_FLUSH = DbConstants.DB_FLUSH;
  574.         DB_GET_BOTH = DbConstants.DB_GET_BOTH;
  575.         DB_GET_RECNO = DbConstants.DB_GET_RECNO;
  576.         DB_JOIN_ITEM = DbConstants.DB_JOIN_ITEM;
  577.         DB_KEYFIRST = DbConstants.DB_KEYFIRST;
  578.         DB_KEYLAST = DbConstants.DB_KEYLAST;
  579.         DB_LAST = DbConstants.DB_LAST;
  580.         DB_NEXT = DbConstants.DB_NEXT;
  581.         DB_NEXT_DUP = DbConstants.DB_NEXT_DUP;
  582.         DB_NEXT_NODUP = DbConstants.DB_NEXT_NODUP;
  583.         DB_NODUPDATA = DbConstants.DB_NODUPDATA;
  584.         DB_NOOVERWRITE = DbConstants.DB_NOOVERWRITE;
  585.         DB_NOSYNC = DbConstants.DB_NOSYNC;
  586.         DB_POSITION = DbConstants.DB_POSITION;
  587.         DB_PREV = DbConstants.DB_PREV;
  588.         DB_PREV_NODUP = DbConstants.DB_PREV_NODUP;
  589.         DB_RECORDCOUNT = DbConstants.DB_RECORDCOUNT;
  590.         DB_RMW = DbConstants.DB_RMW;
  591.         DB_SET = DbConstants.DB_SET;
  592.         DB_SET_RANGE = DbConstants.DB_SET_RANGE;
  593.         DB_SET_RECNO = DbConstants.DB_SET_RECNO;
  594.         DB_WRITECURSOR = DbConstants.DB_WRITECURSOR;
  595.         DB_DBT_MALLOC = DbConstants.DB_DBT_MALLOC;
  596.         DB_DBT_PARTIAL = DbConstants.DB_DBT_PARTIAL;
  597.         DB_DBT_REALLOC = DbConstants.DB_DBT_REALLOC;
  598.         DB_DBT_USERMEM = DbConstants.DB_DBT_USERMEM;
  599.         one_time_init();
  600.     }
  601. }
  602. // end of Db.java