Reputation: 517
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!
Upvotes: 0
Views: 964
Reputation: 123689
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.
Upvotes: 0
Reputation: 10543
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:
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:
All three offer Server and Embedded mode, H2 has mixed mode as well. All three are open source.
Upvotes: 2
Reputation: 75386
Use Apache Derby embedded in your application. This keeps it simple while still using standard JDBC.
H
Upvotes: 0