我用 derby db 开发了一个应用程序。我已经在我的系统中创建了数据库。我需要将应用程序与数据库一起交付。我已经删除了表中的所有数据。仅保留表(具有空数据的结构)。因此,如果我将数据库文件(log、seg0、tmp、db.lck、service.properties 所有这些都放在一个文件夹中)复制到另一个系统,它会正常工作吗..?
最佳答案
是的,它会正常工作,但为了最干净的流程,您应该确保在复制数据库文件夹时没有应用程序正在访问数据库。
来自 Derby 文档:http://db.apache.org/derby/docs/10.10/getstart/cgsintro.html
The on-disk database format used by Derby is portable and platform-independent. You can move Derby databases from machine to machine without needing to modify the data. A Derby application can include a pre-built, populated database if it needs to, and that database will work in any Derby configuration.
有关将数据库与应用程序打包的详细信息,请参阅:http://db.apache.org/derby/docs/10.10/devguide/cdevdeploy32171.html
关于derby - 将 Apache derby 数据库文件复制粘贴到另一个系统中是否可以正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20933116/