/ Published in: Java
Factory for ObjectContainer for local db4o database
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import java.io.File; import com.db4o.ObjectContainer; import com.db4o.ObjectServer; import com.db4o.cs.Db4oClientServer; import com.db4o.cs.config.ServerConfiguration; public abstract class Db4oConnManager { private final static ObjectServer db; static { ServerConfiguration conf = Db4oClientServer.newServerConfiguration(); db = Db4oClientServer.openServer(conf, DB4O_DB_FILE, 0); } public static ObjectContainer getManager() { return db.openClient(); } public static void clear() { db.close(); } }