1

I have developed a desktop application in java using netbeans and Mysql as my DB.

How can I create an .exe file including the database so that it that my application could be executed on other device?

Rann Lifshitz
  • 4,040
  • 4
  • 22
  • 42

1 Answers1

1

Starting with MadProgrammer's quote:

AFAIK MySQL is database server, meaning it doesn't operate in standalone mode. This would mean that you would need to install MySQL on your target machine - which kind of seems counterintuitive. If you want a standalone database, then maybe h2 would be a better alternative, it's a pure Java SQL database system, which doesn't require any additional installation

The simplest option is to use an internal DB, so that every resources will be bundled into a single application.

Otherwise - How can handle the external DB related issue (it being an application running alongside your java application)?

By creating a dedicated installation flow (running dedicated scripts which will install required 3rd party solutions prior to allowing your application to be executed):

  1. Install the DB of your choice.
  2. Optionally allow initial configurations to be aplied to the DB.
  3. Install your own application.
  4. Finalize the binding between the DB and your application.
  5. Configure the OS to optionally run the installed DB on startup.

As for having an .exe executable for your java application - see the references I have provided. A 3rd party tool should easily create a .exe that will suite your needs.

A batch file which encapsulates the java -jar ... command can also work.

References:

Rann Lifshitz
  • 4,040
  • 4
  • 22
  • 42