开发者

Is there any way to save embbeded apache derby database files in jar

开发者 https://www.devze.com 2023-04-10 20:49 出处:网络
In my project when i clicked the jar file it extracts embedded database files to near it self. Is there any way to开发者_JAVA技巧 make them stay in the jar file?You can package a read-only Derby data

In my project when i clicked the jar file it extracts embedded database files to near it self.

Is there any way to开发者_JAVA技巧 make them stay in the jar file?


You can package a read-only Derby database into one of the jar files in your classpath, and access it using a different form of the connection URL. See: http://db.apache.org/derby/docs/10.8/devguide/cdevdvlp24155.html and http://db.apache.org/derby/docs/10.8/devguide/cdevdeploy11201.html#cdevdeploy11201


Sure it's possible, you can put your DB image into any JAR's classpath and access it using:

Class.getResourceAsStream()
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号