Java Reference
In-Depth Information
Self-Test Exercises
7. What is meant by persistence ?
8. What event-handling model is used with JavaBeans?
19.4
Java and Database Connections
It is a capital mistake to theorize before one has data.
Sir Arthur Conan Doyle
(Sherlock Holmes), Scandal in Bohemia
As an example of how Java has been extended to interact with other software systems,
in this section, we will briefly describe how Java interacts with database management
systems. This introduction is just enough for you to construct and manipulate
databases at a fairly basic level. The intent of this section is to introduce some
common database manipulations to let you know what kinds of things are available to
you for database programming in Java.
Relational Databases
A database is a structured collection of data, and the software that manages a database
is known as a database management system ( DBMS ) . A DBMS is especially useful
when dealing with a large amount of data, because it simplifies the data creation,
storage, and retrieval from the perspective of an application. Consequently, a database
system is almost universally employed with any large-scale application that requires the
storage of information. For example, applications that manage financial transactions,
employee records, products, or customer data will typically use a database.
The most common database model used today is the relational database , which
was defined by Edgar Codd at the IBM Almaden Research Center in 1970. A relational
database refers to a collection of relations, which are more commonly referred to as
tables . A table consists of records that comprise the rows of the table. The fields for
each record comprise the columns of the table. Tables may be related to one another
through their fields, hence the term relational database .
database
management
system
(DBMS)
relational
database
Java DB and JDBC
In this section, we will give examples based on Oracle's relational database management
system called Java DB . Java DB is a version of the open source database known
as Apache Derby . It is packaged with version 6 or higher of the Java Software
Development Kit (SDK). Depending on what version of the Java SDK that is installed
on your system, you may not have the complete Derby package (e.g., one that includes
documentation and source code examples) so you may wish to download it from
Java DB
Apache Derby
 
 
Search WWH ::




Custom Search