Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating an installation for a java project

I created a java project that uses a database to retrieve, edit, and save data. I finished the project using Netbeans and now I want to create an installation out of the project. To do so, I want to include the database to be installed along with the project. The code I am using to connect to the database is:

Class.forName("com.mysql.jdbc.Driver");
String connectionUrl = "jdbc:mysql://localhost/mysql?" + "user=root&password=123";
Connection con = DriverManager.getConnection(connectionUrl);

The application is working fine on my pc, but I need it to be installed as an executable on other pcs.

What is the best way to do so?

like image 291
Brute Force Avatar asked Aug 23 '26 02:08

Brute Force


1 Answers

MySQL is a whole database management tool and not suited for an embedded client use. Take a look in the h2 memory database instead.

If you still want to proceed in your path, I would create a archive with your programm and a mysql installation executive. Inside your archive there is a setup script/execute which installs and configures mysql on the client's computer. You want to make it a silent install i.e. there will be wizard and all configuration is done from your installation skript.

like image 195
Lukas Eichler Avatar answered Aug 25 '26 16:08

Lukas Eichler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!