lephleg
lephleg

Reputation: 1764

Local Java Application - Database Selection

I'd like to ask for your opinion on local databases for a java application i'm developing.

Its veterinary application, meaning I'll need to store Customer, Pet and Medical History details for a start. I know how to use JDBC but I've only used it online in applets.

So, I really dont know much about local solutions and how those gonna work when I'll publish the application in a .jar, so please guide me. Would MySQL still work?

Thanks!

Upvotes: 1

Views: 1058

Answers (1)

Ed Plese
Ed Plese

Reputation: 1568

This is fairly general question and light on details and MySQL sounds like it would work here. If this is for local-only access and a typical client-server model is not needed then I'd encourage looking into a database engine that can be loaded directly in the JVM. One of the benefits is that there is no need to install any separate database components and the JARs for the entire database engine can be packaged in your application.

Below are a few of these:

  • Apache Derby
  • HyperSQL
  • H2
  • SQLite - Some Java wrappers around the C library are available but there are not any pure Java JDBC drivers available for this that I am aware of.

I realize that it is not difficult for developers to configure MySQL for local use but it could lead to a number of support issues for end users. It may be possible to script the installation to preconfigure a large amount of it but I am not sure of the details of that and it would be an additional item for you to work out when packaging the application.

Some general questions about utilizing MySQL for this are shown below. It may very well be the best way to go but these are just some things to consider. Most of these are not really specific to the development of the application and are more on the support side of things. Utilizing a database engine noted above can eliminate all or many of these.

  • Will multiple computers every have to connect simultaneously to the same database?
  • What MySQL password do you use?
  • Do you recommend that end users all use the same one which may not be good security?
  • Or do the end users need to create one in which case you may need to deal with forgotten passwords and the end user having to configure the password in your application?
  • Do your end users run antivirus software that may interfere with the database connection?
  • What if they have another program that uses MySQL that is already using the default port?

Upvotes: 2

Related Questions