Answer the question
In order to leave comments, you need to log in
How to properly connect to Berkeley DB in Java?
Hello.
I'm trying to write a Java client to connect to BerkeleyDB.
D:\\DataBases\\BerkeleyDB\\12cR1(12.1.6.2.23)\\bin\\ already has a saved CUSTOMERS table
try {
EnvironmentConfig environmentConfig = new EnvironmentConfig();
environmentConfig.setAllowCreate(true);
File file = new File("D:\\DataBases\\BerkeleyDB\\12cR1(12.1.6.2.23)\\bin\\CUSTOMERS");
Environment environment = new Environment(file, environmentConfig);
DatabaseConfig databaseConfig = new DatabaseConfig();
databaseConfig.setAllowCreate(true);
// databaseConfig.setDeferredWrite(true);
databaseConfig.setTransactional(true);
Database testDatabase = environment.openDatabase(null, "CUSTOMERS", null, databaseConfig);
testDatabase.sync();
testDatabase.close();
} catch (Exception e) {
out.println( "<h1>exception: "+e.getClass().getName() + ": " + e.getMessage()+"</h1>" );
}
org.apache.jasper.JasperException: An exception occurred processing JSP page /check_db/check_berkeley.jsp at line 131
128: EnvironmentConfig environmentConfig = new EnvironmentConfig();
129: environmentConfig.setAllowCreate(true);
130: File file = new File("D:\\DataBases\\BerkeleyDB\\12cR1(12.1.6.2.23)\\bin\\CUSTOMERS");
131: Environment environment = new Environment(file, environmentConfig);
Answer the question
In order to leave comments, you need to log in
How to convert BerkeleyDB to BerkeleyDB JE?
Various formats. For some reason.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question