Java Reference
In-Depth Information
Chapter 10
Database Access
In this chapter, you will learn about the objects needed to access a DBMS (Database Management System). In addition,
we will cover the architectural topic of data encapsulation and use SQL as the data access language. We will then
demonstrate how to configure the RAD and PC environment to connect to a DBMS and how to access the database
from Java applications.
In this chapter, you will learn about:
JDBC
ODBC
The following objects:
Class
DriverManager
Statement
Connection
ResultSet
Drivers
SQL
CRUD
After this chapter, you should be able to:
Access an IBM DB/2, Oracle, or Microsoft Access (MS Access) database from a Java
application
Create a database table
Insert, modify, retrieve, and delete information from a database table
Why Databases?
Databases hold the information most organizations need to perform their daily activities. For instance, a grocery store
keeps all their prices in a database. When you go through checkout, the price for each item in the cart is retrieved
and used to calculate the total amount owed. Databases are so essential that if the database is unavailable, most
applications cannot function. In Java-speak this is because DBMSs provide “data persistence.” Java objects do not
provide data persistence. In other words, when an object is deleted any information the object contained is also
deleted. With a DBMS, data is safely stored and accessible whether an object exists or not.
 
Search WWH ::




Custom Search