It has been a long time since I have programmed anything. Grew-up in the 80's using basic.
I am currently somewhat fluent in JAVA(R) but I need some help understanding the current state of databases.
I am developing a cd that needs a stand alone database for the Java program that I am writing.
I am using WindowsXP.
What is a good database that is simple to use?

I know this is a generic question just let me know what I am leaving out and I will fill in some detail.

Thanks,

Dani AI

Generated

Two points to decide up front for : does the database need to be writable at runtime, or can it be read-only? A CD is effectively read-only, so if the app must update data it should ship a seed DB on the CD and copy that file to a writable folder on first run. If the data is static, a simple flat file (CSV) works fine — as noted — but for transactional updates and queries use an embedded DB engine.

For a small, standalone Java app that you can bundle on a CD, choose a pure-Java, embeddable engine (no separate server install). Mature options include HSQLDB, H2, and Apache Derby. SQLite is a great file-based engine too, but you need a JDBC wrapper to use it from Java. These engines are distributed as single jars, speak JDBC/SQL, and are easy to include in your jar/classpath.

Packaging checklist and a minimal workflow:

  • Put the DB engine jar on your classpath.
  • Include a seed DB or seed CSV on the CD.
  • On first run copy the seed to a writable location (user home, %APPDATA%, ProgramData).
  • Open the DB with a file-based JDBC URL that points to the copied file.
    Example sketch (copy resource + open file-based DB):
InputStream seed = MyApp.class.getResourceAsStream("/seed-db");
Files.createDirectories(targetDir);
Files.copy(seed, targetDir.resolve("appdb"), StandardCopyOption.REPLACE_EXISTING);
String url = "jdbc:hsqldb:file:" + targetDir.resolve("appdb").toString() + ";shutdown=true";
Connection conn = DriverManager.getConnection(url, "SA", "");

Troubleshooting notes: include the correct driver jar, test first-run copy and clean shutdown to avoid corruption, and do not let multiple JVMs access the same embedded file (use server mode or a network DB if you need concurrent multi-process access). Build a small installer or first-run routine to place the writable DB in the right directory and to set correct permissions. This approach keeps distribution simple and avoids requiring users to install a separate database product.

Recommended Answers

All 2 Replies

hmmm. I know nothing about Java.... what file types can it accept?
I assume that it can take in text - comma/tab delinated files, so almost any DB program can provide that sort of output.....

It depends on whether you need the DB to ge with the Java, or just to start it off with a DB back end...
Let us know more, and you'll find more help!

Hi

I would suggest that you go for MS ACCESS to design ur database as it is one of the easiest tool you can use

You can also use Oracle if you have got a basic understanding of databases
(relational)

And then if you write a Java program, you could connect your application to the database using JDBC/ODBC

I think this information could do. You can just visit the website and can learn a lot

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.