2

I am developing a medium scale billing/auditing software in Java. Which database can be used such that it:

  1. can be used for standalone desktop application.
  2. can easily install along with application.
  3. is easily portable along with a Java application like Excel, MS Access.
  4. is an embedded DB so that it can easily package along with application.
  • 1
    What amount of data we talking about here: some Megabytes, Gigabytes, …? – Izzy Jul 22 '15 at 6:48
  • To help you choosing among the answers, if you are using Spring within your application, you should know that it offers support for some embedded DBs (namely HSQL, H2 and Derby). – Chop Jul 23 '15 at 9:35
5

This answer makes the assumption that "medium scale" refers to a few Megabytes at max (as the question gave no further details)

I'd say go with SQLite:

  • can be used for standalone desktop application: Yes. The same for web apps or mobile applications.
  • can easily install along with application: Definitely. That's what Android apps do.
  • is easily portable along with a Java application like Excel, MS Access: I don't understand that comparision – but yes, it's available cross-platform, and you can simply share the database file to access its data with other apps.
  • is an embedded DB so that it can easily package along with application: Yes, again that's what Android apps do.

I'm using SQLite in several of my web apps (e.g. my eBook server uses it), working with different sizes. The German library's database file just passed the 10 MB limit, and I see no drop in performance or the like. SQLite is used in many applications, and even is the default choice when it comes to Android apps (which are written in Java) – so I'd say, by the specifications given, it will be a good choice for your project.

  • While this answer is correct, keep in mind that SQLite is relatively limited in features. The inventor himself recent explained that SQLite is not meant to be an alternative to Postgres (a powerful enterprise-quality database) but rather an alternative to fopen (a programmer’s tool to open plain text files). – Basil Bourque Jul 23 '15 at 7:18
2

If you're using Java and it needs to be embedded - look at JavaDB. It's embedded in the JVM, so if you're running a newer version of Java (7 or 8), it's already there. It's basically a rebranded version of Apache Derby, so if it works with Derby, it works with JavaDB. You can easily work in an embedded environment, or expand all the way up to a client/server implementation.

You also have similar capabilities to a larger SQL-based database (schemas, roles, triggers, indexes, constraints, sequences, etc.), so you can easily grow up to one of them as needs expand (although Derby can handle several GB of data).

Another thing to consider is that since you're dealing with financials (billing/auditing), data integrity is of utmost concern. For that reason alone I'd limit what I'm looking at to something that enforces data types, referential integrity, and permissions.

2

H2

H2 is an open-source pure Java library under active development for many years.

The principal author is quite experienced. He also created the HyperSonic database that forked into HSQLDB, and the author also worked on a commercial database product.

H2 is comparable to the Apache Derby / JavaDB product mentioned in another answer. But you might find H2 to be somewhat simpler administratively, and better suited for embedded usage.

H2 is much more of a fully-featured database system than SQLite.

1

Have you looked at the Oracle Berkeley DB?

can be used for standalone desktop application.

From the link above:

Berkeley DB Java Edition is highly portable, very flexible and easy to integrate. It was designed from day one as a pure Java product taking full advantage of the Java environment. As a single Java Archive (JAR) file, it runs within the JVM running your application

can easily install along with application.

See above

is easily portable along with a Java application like Excel, MS Access.

You will be able to write an export for the data to Excel. I've not found a 100% reliable way of connecting the DB to excel or access. That said, I've not spent that much time looking.

is an embedded DB so that it can easily package along with application.

Just add the JAR file with your application and you are good to go, from my understanding

An here's a quick run-down of the points they list on the site above:

  • 100% pure Java for portability and ease of development
  • Single JAR file - easy to install, runs in the same JVM as the application
  • Java 1.5 or later Standard Edition JVM required
  • Programmatic administration and management
  • Small footprint 820KB
  • Scalable to terabytes of data, millions of records
  • Source code, test suite included
0

Surely, The latest AnDatabase is the best way to organize data in lite weight java desktop applications For Java, Python, Kotlin Desktop AnDatabase https://github.com/anongrp/AnDatabase

Features :-

  1. No SQL Required, SQL Free Database
  2. Fast and Highly Secure
  3. Table Exportation Support (To CSV for Excel & JSON File for Web Data Sharing)
  4. Data Stored In Highly Secured Encryption Algorithms With Encryption Key That's Only Developer Knows.
  5. Easy Implementation Only Maximum 10 Lines Of Code Required For Implementing AnDatabase
  6. AnDatabase simply organizes the data in a tabular manner.It follows RDBMS for storing data.
  7. Open Source Free To Use

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.