0

I am trying to read a generated database (*.jdb) file.

For creating a new database I use:

    storeConfig_ = new StoreConfig();
    storeConfig_.setAllowCreate(true);

What StoreConfig parameters must I pass in to read an already existing *.jdb file?

Stelios
  • 1,294
  • 3
  • 12
  • 28

1 Answers1

0
  1. Configure the environment.
  2. Create environment defining it's location.
  3. Create new EntityStore using the predefined DAO.
  4. Then you can access the database using the index.

    EnvironmentConfig envConfig = new EnvironmentConfig();
    
    try {
        myDbEnvironment_ = new Environment(new File(getDatabasePathString()), envConfig);
    } catch (DatabaseException e) {
        e.printStackTrace();
    }
    DAO.store_ = new EntityStore(environment, "EntityStore", new StoreConfig());
    Index_ = store_.getPrimaryIndex(String.class, Page.class);
    
Stelios
  • 1,294
  • 3
  • 12
  • 28