1

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!

1 Answer 1

2

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?
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for the answer! Does SQLite belong to the list above?
Also what other details are needed here? I've described the app and what I intent to store in DB. I dont know what else should I include to be more specific.. :-/
I added SQLite and the comment given is the reason I had originally excluded it. Also I added some questions to think through.
Sorry for the delay. I think you covered me on many topics. I give it a try and I'll post a new question if I find myself troubled. Thanks Ed!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.