The localStorage interface (see Chapter4) provides a very nice interface for storing
small amounts of data, but the browser limits this storage space to 5 MB in
many cases. If the storage needs of an application go beyond that, or if the
application needs to have query access to structured data, local storage is not the best
choice. In this case, having a more robust storage mechanism can be useful
for the application developer. IndexedDB provides this mechanism on many
browsers. For example, a programmer may store product catalog data into an
IndexedDB store so that when the user searches for an item, the server does
not need to make a trip to the server to find the data for a particular
IndexedDB is a NoSQL database that will feel familiar to people who
an IndexedDB data store.
IndexedDB has been in Firefox starting with version 4. It also was introduced
into Google Chrome starting with
version 11. Microsoft has a version online at its HTML5 Labs
website as an ActiveX control, which
can be added into IE, and presumably it will be in the main IE release at some
point. It will probably be available in other browsers in the next year or
two. Formally, IndexedDB is now a draft
proposal from the W3C.
It was a trial that captured the imagination of the public. Gaston Naessens stood accused of criminal negligence in the death of a cancer patient who had been treated with his elixir 714X instead of undergoing conventional treatment. Not only Naessens, but all of “alternative medicine” seemed to be on trial in that courtroom in Sherbrooke, Quebec, back in 1989. The French-born biologist claimed that his studies had led him to investigate the true cause of cancer, which he found to be the uncontrolled growth cycle of “somatids,” living organisms distinct from bacteria and viruses. Mainstream medicine had missed their existence, he said, because they were too small to be seen with an ordinary microscope. But Naessens had devised an instrument, “the somatoscope,” that allowed these organisms to be visualized, and the presence and progress of cancer to be monitored. He then theorized that somatids could be returned to a normal state by injection with a drug he had developed. Naessens took great pride in his creation, naming it 714X. The numbers 7 and 14 served to represent his initials (the seventh and fourteenth letters of the alphabet), and X, the twenty-fourth letter, stood for the year of his birth, 1924.
I was talking with some friends recently, friends who don't own
a computer. They were thinking of getting one so they could use
Amazon.com to buy books and CDs. Not to use "the
Internet," not to use "the Web," but to use
Now, that's the classic definition of a "killer
application": one that makes someone go out and buy a computer.
What's interesting is that the killer application is no longer
a desktop productivity application or even a back-office enterprise
software system, but an individual web site. And once you start
thinking of web sites as applications, you soon come to realize that
they represent an entirely new breed, something you might call an
"information application," or perhaps even
Information applications are used to computerize tasks that just
couldn't be handled in the old computing model. A few years
ago, if you wanted to search a database of a million books, you
talked to a librarian, who knew the arcane search syntax of the
available computerized search tools and might be able to find what
you wanted. If you wanted to buy a book, you went to a bookstore, and
looked through its relatively small selection. Now, tens of thousands
of people with no specialized training find and buy books online from
that million-record database every day.
The Java Persistence API (JPA) is defined as JSR 317, and the complete specification can be downloaded
JPA defines an API for the management of persistence and object/relational mapping using a Java domain
A database table, typically with multiple columns, stores the
persistent state of an application. Multiple rows are stored in the database
table to capture different states. A single column or combination of columns
may define the uniqueness of each row using primary key constraint.
Typically, an application accesses and stores data to multiple tables. These
tables generally have relationships defined among them using foreign key
JPA defines a standard mapping between a database table and a POJO. It
defines syntax to capture primary and foreign key constraints and how these
rows can be created, read, updated, and deleted using these POJOs.
Transactions, caching, validation, and other similar capabilities required
by an application accessing a database are also defined by JPA.