Deploying Apache Derby Nested Mode
I have a Java application that has an embedded Derby database (although not hibernating). The application uses the following properties:
datasource.driverClassName = org.apache.derby.jdbc.EmbeddedDriver
datasource.url = jdbc:derby:C:/derby/mydb;
datasource.username = 1234
datasource.password = 1234
Everything works fine and great. Now I need to package everything and provide it to the 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 the database.
Questions: where should the Derby be in the JAR? and what should "datasource.url" be?
Thanks in advance.
source to share
You can find the database data files inside your web application. For example, in "WEB-INF / data /" (and the Derby driver file in "WEB-INF / lib /" of course).
So, you can use a preconfigured database (with the JDBC url "relative path") in the WAR file that you pass to your client. It will not need to manually install Derby DB.
Note: you need to be careful if you provide an application update (so as not to erase the database).
source to share