简体   繁体   中英

Apache Derby Embedded Mode Deployment

I have a Java app that has an embedded Derby database (no hibernate though). The app is using the following properties:

datasource.driverClassName = org.apache.derby.jdbc.EmbeddedDriver
datasource.url = jdbc:derby:C:/derby/mydb;
datasource.username = 1234
datasource.password = 1234

Everything is working fine and great. Now I need to package everything and give it to a client to install on their GlassFish server now I don't want the client to install Derby and I don't want them to know that the application is using a database.

The questions are: where should Derby be in the JAR? and What should the "datasource.url" be?

Thanks in advance.

You can locate the database data files inside your web-app. For example in "WEB-INF/data/" (and the Derby driver file in "WEB-INF/lib/" of course).

So, you can embbed the database pre-configured (with a "relative-path" JDBC url) in the WAR file you give to your client. He won't have to install manually a Derby DB.

Note : you'll have to be careful when you'll provide an update of the application (to not erase the DB).

债务数据库将位于documens netbeans上,您尚未对其进行更改即可使其工作,只需将derby数据库填充并粘贴到dist文件中即可,现在将dist文件移动到新位置,例如桌面,例如,希望这对您有所帮助。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM