Java Reference
In-Depth Information
interface is sufficient because it is used only once. The third and final task is to
create a data access class, StockTrackerDB (Figure 11-1c). This class provides
access to the database for other applications. All programs, except the utility pro-
gram, only access the database through calls to methods of the StockTrackerDB
class.
Console u tility:
creates database
tab les and first
reco rd , then lists
resu lts
Control Panel:
Create ODBC
Data Source
JDBC™ API
(depends on DBMS used)
ODBC-
accessible
DBMS
JDBC™ Driver
(a) Task 1: Create ODBC Data
Source Name and assign to
database
ODBC
ODBC-
accessible
DBMS
(b) Task 2: Create and execute console utility program
Results passed from
database to JDBC (via
ODBC to driver) to
Data Access class to
GUI application
Requests passed from
GUI application to
Data Access class to
JDBC to database (via
driver to ODBC)
GUI
application
Data Access Class
(StockTrackerDB)
JDBC™
JDBC-ODBC driver
ODBC
Access™ Database
(c) Task 3: Build Data Access class
(StockTrackerDB) to handle all
database interaction for GUI
application program
Application interacts
with database through
cooperating layers
of software
FIGURE 11-1
 
Search WWH ::




Custom Search