Apache Derby嵌入式模式部署 [英] Apache Derby Embedded Mode Deployment
问题描述
datasource.driverClassName = org.apache.derby.jdbc.EmbeddedDriver
datasource .url = jdbc:derby:C:/ derby / mydb;
datasource.username = 1234
datasource.password = 1234
一切正在工作罚款不错现在我需要打包所有的东西,并将它交给客户端安装在GlassFish服务器上,现在我不希望客户端安装Derby,我不希望他们知道应用程序正在使用数据库。
问题是:Derby应该在JAR中? dataource.url应该是什么?
提前感谢
您可以在Web应用程序中找到数据库数据文件。例如在WEB-INF / data /(当然,在WEB-INF / lib /中的Derby驱动程序文件)。
数据库在您提供给您的客户端的WAR文件中预配置(使用相对路径JDBC url)。他不必手动安装Derby DB。
注意:当您提供应用程序的更新时,您必须小心(不要擦除) DB)。
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).
这篇关于Apache Derby嵌入式模式部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!