-size: 90%;">import tokyocabinet.*;
import java.util.*;

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

    // create the object
    TDB tdb = new TDB();

    // open the database
    if(!tdb.open("casket.tct", TDB.OWRITER | TDB.OCREAT)){
      int ecode = tdb.ecode();
      System.err.println("open error: " + tdb.errmsg(ecode));
    }

    // store a record
    String pkey = new Long(tdb.genuid()).toString();
    Map cols = new HashMap();
    cols.put("name", "mikio");
    cols.put("age"