How to provide java application with database?

牧云@^-^@ 提交于 2019-12-25 04:24:35

问题


I have a database-driven application (Apache Derby). I connect to the database by a URL:

jdbc:derby://localhost:1527/kcal_calc_db

My database was created via NetBeans, and is in the '.netbeans-derby' folder. How can I include this database with my JAR/EXE file?


回答1:


Try this related question: Distribute a database made with JavaDB with Java program

Note that you'll want your database to be accessed as an Embedded database, not a Client-Server database, so you'll need to change your Connection URL, use the Embedded JDBC driver, package derby.jar into your application, etc.



来源:https://stackoverflow.com/questions/22132069/how-to-provide-java-application-with-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!