0

I need to create a simple Java application that connects to a local database file, and will run on a mac.

I've figured that JDBC is a good option, but what file format/drivers should I use? Is .MDB files a possibility?

Thanks for any help!

1
  • You can use any database engine which provides a JDBC driver. Choices are aplenty. Commented Jul 27, 2013 at 12:06

3 Answers 3

2

For a small DB I would suggest using a DB written in Java. The DB's below or all < 2mb. Keeping it in java means it is easy to transfer to Windows / Linux if need be.

Possible DB's include:

H2 - H2 has a mixed mode where the first time the DB is opened it is op Advantages:

  • Mixed Mode
  • Only a couple of Files
  • has built-in SQL

HSQLDB - Version HSQLDB 1.80 is the smallest jar of the three (by a big margin) The 2.* jars are similar in size to H2 Advantages:

  • Small size (Version 1.80)
  • Only a couple of Files

Apache Derby

All three offer Server and Embedded mode, H2 has mixed mode as well. All three are open source.

Sign up to request clarification or add additional context in comments.

Comments

0

Use Apache Derby embedded in your application. This keeps it simple while still using standard JDBC.

H

Comments

0

Is .MDB files a possibility?

It could be, via a library like UCanAccess. However, using an Access database (.mdb or .accdb) would only be advisable if there was some other compelling reason to do so, e.g., to take a copy of the database file and use it with some other application that requires an Access database.

Otherwise, one of the suggestions from the other answers would probably be a better choice.

Comments

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.