How can we store the data in files instead of a database? What advantages and disadvantages would this have?
Every good book on databases will contain at least one chapter describing the situation before the development of databases. Spend some time creating the following file:
Wiesner, Stephan; Struts Book; 01.02.2004; 34,99 Müller, Lieschen; Grow Roses; 03.12.2003; 13,98 Beutling, Frodo; Adventure in the wilderness; 03.02.2004; 47,00 Bergsten, Dietrich, Programming for everybody; 05.05.2004
Now try to read the individual rows and columns and sort them. Search in the file for all the orders placed in a certain time frame and within certain price range. Naturally, you have to write a second program to access the file. You will now understand how strenuous this is and will learn to admire a good database.
A side aspect is naturally the resource hunger of any database. The Oracle 9 standard installation takes almost 1GB of space on disk. This is unimaginable for an application that runs on Mobile phones. On the other hand, HSQLDB (http://www.hsqldb.org), which is an open‑source Java Database, requires only 160 KB of main memory.