Brian T Hannan
Brian T Hannan

Reputation: 4005

How do I allow a user to install MySQL on a user's machine more easily so they can connect to it via a Java application?

Let's say I have written an application in Java that is programmed to use a MySQL database. The user of the Java application needs to have MySQL on their machine in order for the application to work.

What can I do to make sure that the user has the correct version of MySQL on their machine and if they don't then install it so they can properly run the Java application?

Note: I had sent some links to setup Java and MySQL for a business analyst of a program I am working on and he was not able to decipher the madness that is installing MySQL. He is not computer technical and wouldn't even know what to enter into the forms of the MySQL installation. What could I do to ease this task for the end user?

Update: Unfortunately, for security reasons that are a requirement for this project we have to use MySQL and not SQLite or Derby. Unless there is a way to make sure that no one deletes the SQLite database file or switches it out for another one. We need to guarantee data integrity and I find that using MySQL gives me the best chance at doing that.

Upvotes: 0

Views: 61

Answers (2)

Matt Ball
Matt Ball

Reputation: 359836

The easiest thing for the user is to embed the database in the Java application. No setup required. There's MySQL OEM (not free), so you might consider switching to SQLite instead, which is the de facto standard embedded database. (See this question for more on that.)

Upvotes: 0

gmoore
gmoore

Reputation: 5566

What is the target platform?

Assuming something UNIXish, you can either:

1) Include a shell script to download, install, and setup mysql. Complicated, but not impossible.

2) Use an embedded Derby database. On my current project, we have a version where the user can just "download and go." That version uses an embedded Derby database that writes to a file, similar to hsqldb or sqlite3. Any of those are fine options.

Upvotes: 1

Related Questions