Embedded Database ?
I'm developing Swing application that uses database. Currently I'm using MySQL server for database, where I have to configure server IP, port number, user name, password and database name.
The problem is :
I will be distributing this application to my friends, and they won't be having MySQL installed. Nor saying to install MySQL and configure application property in there computer is good idea.
What I'm looking is for embedded database or compact version such that whoever use this application need not to configure database. Just copy zip of this application and paste in his/her PC and run there.
Any suggestion is welcome and thank-you.
I like the "H2" database. H2 Database Engine (redirect) Their documentation on their site is very complete, and there are example web application context start up listeners you can install into your web.xml to have the embedded database started within your web applicaiton. I have even placed H2 databases inside my WEB-INF in the web application.
Another popular and more mature embedded database is the "hypersonic SQL" database. It also has many of these features.
Others include that Java DB (e.g. Apache Derby) that is actually usually bundled with Java run times 1.6 or later.
Of all these, I prefer H2 though for its SQL completeness and similarities with MySQL . and the simplicity of many features (e.g. web admin console, optional server mode process to boot it up on network port if you want to, and jdbc driver) all in a single .jar file.
Thanks for the reply travishein.
I looked at 'H2' site and soon will be trying it, hope it will meet my requirement.
And yeah, I totally forgot about Java DB, I should give it also a try.
I will report further progress.
H2 database, when I went thru it, my first thought was "Is it only for web-apps. Can I really use it in my desktop apps?".
What i really liked about H2 is, it's small and easy to configure. But I don't think its that DB which I was looking for.
But what i came across while searching the WEB, I can use files to store data instead of DB, as data security isn't that importance. What I want is to store data in some proper ways and retrieve in same manner.
But still there is some confusing regarding which to choose (DB or file)? Which is better suited, when I will have couple of hundreds data? I mean i'll have person name, tel no, address etc as data.
If you need to search the data then I'd suggest a db.
What was wrong with H2?
Tolls, thats a good point. I definitely have to search data.
And nothing wrong with H2, just that I'm not well custom to it.
Why not have a look at JavaDB (Derby); as already mentioned it comes with your Java 1.6 JDK distribution and is an ordinary, fully compliant SQL 92 database engine. It comes with two drivers: an embedded one and a network driver. Give it a try; the distribution comes with full documentation and is a breeze to set up.
Originally Posted by Prajin
Yeah, I'm giving a try with JavaDB for couple of days, just some test is left.
you can use h2 database H2 Database Engine , but you have to join h2 lib to project to access it's driver . so you can use sqlite SQLite Home Page