A running application is probably a good application, especially if it does not crash. However, a running application without data is a useless application because the application will not be doing anything meaningful. A typical program will interact with the computer using files and databases. This means taking the state of an executing Java object and saving the state to a file or databases, or vice versa. This changing of state is called serialization or persistence.
Serialization, in the context of this book, takes two forms: database or XML file. The database has proven itself to be a useful and versatile way of storing and manipulating data. With the advent of XML, though, you can cleanly handle unstructured data, in contrast to data in a database. The task in this chapter is to explain how to manage serialization to and from a database and to and from an XML file.