Apache Derby 嵌入式模式部署
我有一个 Java 应用程序,它有一个嵌入式 Derby 数据库(尽管没有休眠)。该应用程序使用以下属性:
datasource.driverClassName = org.apache.derby.jdbc.EmbeddedDriver
datasource.url = jdbc:derby:C:/derby/mydb;
datasource.username = 1234
datasource.password = 1234
一切都工作正常且很棒。现在我需要打包所有内容并将其提供给客户端以安装在他们的 GlassFish 服务器上,现在我不希望客户端安装 Derby,也不希望他们知道该应用程序正在使用数据库。
问题是:德比应该在 JAR 中的什么位置?以及“datasource.url”应该是什么?
提前致谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在网络应用程序中找到数据库数据文件。例如在“WEB-INF/data/”中(当然还有“WEB-INF/lib/”中的 Derby 驱动程序文件)。
因此,您可以将预先配置的数据库(使用“相对路径”JDBC url)嵌入到提供给客户端的 WAR 文件中。他不必手动安装 Derby DB。
注意:当您提供应用程序更新时,您必须小心(不要删除数据库)。
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).
债务数据库将位于文档 Netbeans 上,您还没有更改它以使其工作,只需将 derby 数据库填充并将其粘贴到 dist 文件中,现在将 dist 文件移动到新位置,例如您的桌面,希望这会有所帮助。
The debt database will be on documens netbeans of you haven't changed it to make it work just take the derby database fille and paste it in the dist file now move the the dist file to a new location like your desktop for example hope this helps.