can't locate db4o database file

一个人想着一个人 提交于 2019-12-02 19:27:30

问题


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:


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);


来源:https://stackoverflow.com/questions/14295646/cant-locate-db4o-database-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!