How to Run a Java Application Using MySQL DB on a Computer Without MySQL Installed?

感情迁移 提交于 2019-11-30 21:16:01

问题


I created a java application that is a front end for a MySQL Database using NetBeans and JDBC.

Now after creating the jar file it runs smoothly on my computer (Since I have the MySQL installed) but, if I run the jar on a different computer it won't work since it does not have the DB the application is using and not even MySQL installed.

So the question is, is it possible to add the database to the executable jar so it will run on any computer without the need for any installation of any software (Except for JRE of course) ?

If yes, how do I go about doing so?

Thanks everyone for the help in advance.


回答1:


Use derby database. It already included in JDK's db folder when you installed the Java on your computer.




回答2:


If you purely want to use the database without using the MySql then simply using the collections to create database, then you doesn't need any other database client as like MySql. But you need knowledge of Hibernate, Spring etc.



来源:https://stackoverflow.com/questions/28164165/how-to-run-a-java-application-using-mysql-db-on-a-computer-without-mysql-install

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