    }

    // close the database
    if(!hdb.close()){
      int ecode = hdb.ecode();
      System.err.println("close error: " + hdb.errmsg(ecode));
    }

  }
}
</pre>

<p>The following code is an example to use a B+ tree database.</p>

<pre style="margin: 0em 0.8em; padding: 0.3em; background: #eeeeff none; border: 1px solid #cccccc; font-size: 90%;">import tokyocabinet.*;

public class TCBDBEX {
  public static void main(String[] args){

    // create the object
    BDB bdb = new BDB();

    // open the 