I am using a standalone java application.. no webservice or nothing.. I have all the data(good enough to make a DB) required for my application with numerous objects.. yes.. I am simply hardcoding in my classes and constructing it while my application runs.... my application is running perfect and is quick...
but people say it is good only to maintain tables of data in a separate DB rather than hardcoding it.... but making a separate connection to a DB and fetching my application data from it would make my application slower instead of improving it.. but i also want to follow the best practise of having one DB...
can you please tell me what improvements i would get for my application by maintaining a separate DB? i have no issues in changing the code and deploying the jar everytime i change the data values..
if i have to really use a DB then which type of DB i should opt for.. please suggest some solution free of cost... is there any free to use oracle DB system? my application is not very enormous to go for a licensed DB system..
Thanks in advance..... and this my first in JavaRanch
A database is generally only useful if you need the services it offers - be it atomicity, concurrency or constraint enforcement. Unless there is a need for users to change the configuration, or to share common configuration among many computers (which would make frequent redeployment a daunting task), I don't see any advantage of putting them into database in the situation you described. I'd say that unless the app needs a database anyway, requiring a database just for what you've described would only add an unnecessary overhead.
You might consider storing the configuration in XML or property files (possibly even within the distributed JAR) instead.
Unfortunately, I'm not very good at XML myself. I suppose that lots of XML tutorials exist, though (try Google, I'd pick one from Sun/Oracle to begin with). Generally there are XML parser libraries, you should not read and interpret the XML file yourself!
Another option might be to use Java serialization and deserialize objects directly from XML files. Certainly harder to maintain the XMLs by hand, but very elegant in other aspects (you'll get objects from the XML files with very little code).
subject: Why do we need a database? or why do i need it?