Embed mysql database in java application

I am making an application java

using netbeans

which connects to a database, but I have a problem, I want to insert the database mysql

with the jar executable, so when I take that file jar

and run it on any PC that does not have a mysql server, it will work with a database, I was thinking about including mysql-installer.exe and a make script to install the mysql server, but I can't find how to do it, also I read about Connector / MXJ, this works if the user runs the application and it has no mysql server, any suggestions or articles about this.

+1


source to share


2 answers


Derby is a pure-java DBMS. You link the derby can with your program just like any other library. This is a much cleaner way to ensure that your user has a db for your program since you are not adding any dependencies.



+1


source


Usually distributors do not include stand-alone databases such as MySQL or Oracle with their expression. They provide a SQL script as needed to create the database and enter the user type into the host, the database username and password, and create a script to create the database. If you want to "ship" a database with your application, I would consider lighter databases such as SQLite (singe file database).



0


source







All Articles