开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜