1

I have prepared an application that is a small demo of Student information manipulation. I have stored information related to students in a MySQL DB. Now my application is working 100% on my computer. But I want that work everywhere without depending on Database! I mean I just want "WHEREVER MY .JAR FILE GOES, DATABASE SHOULD ALSO GO ALONG WITH THAT INSIDE .JAR FILE "

So anyone who is using my application or trying it, they can realize exact result of this application.

How can I make this possible? Please someone help me.

Nico Huysamen
  • 10,217
  • 9
  • 62
  • 88
Rushi3311
  • 253
  • 2
  • 4
  • 11

2 Answers2

3

You will probably need to look at something like HyperSQL, which is a in-memory database (which you will need to populate at application start-up). Or have a look at SQLite, which is an embedded databsase, which you can distribute as a resource in your jar.

Nico Huysamen
  • 10,217
  • 9
  • 62
  • 88
2

This doesn't work. MySQL is a full-blown RDBMS. You would have to install it on every computer if you want application to use it locally. An alternative would be using SQLite.

SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.

SQLite and Java

SQLite seems to be a good fit for your requirements.

Community
  • 1
  • 1
Jacob
  • 41,721
  • 6
  • 79
  • 81
  • It's actually a bit finicky to use a SQLite database with(in) a JAR ... this is because SQLite requires direct-file access. The actual distribution of the SQLite library is easy. –  Dec 11 '11 at 06:23