can't locate db4o database file

2019-03-04 15:23发布

Hello I'm coding a simple CRUDE application that runs perfectly using JSF and DB4O. I can add and list all the entities normally without errors. I've used this code to persist the entities

bd = Db4oEmbedded.openFile(configuration, "db.data");
        bd.store(client);
        bd.commit();

the problem is that I cant locate the db.data file. I,ve done a search in the whole PC and still cant find it. soo where DB4O store those entities, how is it possible?? thank you.

1条回答
对你真心纯属浪费
2楼-- · 2019-03-04 15:37

It must be in your project execution path. Usually db4o file name is called with extension yap. Better you can use relative path to the database file like

String dbPath = "c:/db/project.yap"; // better read from project resource
EmbeddedObjectContainer openFile = Db4oEmbedded.openFile(dbPath);
查看更多
登录 后发表回答