Java Reference
In-Depth Information
JDBC Basics
Now that we have discussed what the JDBC is and some of its characteristics, let's start learn-
ing how to use it. In this section, we will discuss how to install and set up a Type 1 driver,
make a connection to the database, and perform the basic SQL commands.
Installing and Setting Up a Type 1 Driver
In the JDBC examples throughout this topic, you will be connecting to a Microsoft Access
database using a Type 1 driver. To install the JDBC-ODBC Bridge, download the JDK and fol-
low the installation directions. The JDBC-ODBC Bridge is included in version 1.1 and later.
The JDBC-ODBC Bridge requires no specific setup steps, but the ODBC driver does. For our
examples, assume that you are using a PC and running Windows NT or 2000. If not, you will
need to create your own database using the drivers supplied by your database vendor.
To configure the ODBC data source for the examples, you will follow these steps:
1.
Copy to your local drive the database file moviecatalog.mdb , which can be found on the
topic's Web site.
2.
Start the application ODBC. You will see a window similar to the one in Figure 7.7.
F IGURE 7.7
The ODBC Administrator.
3.
Select the System DSN tab and click the Add button to add a new data source. Figure 7.8
shows the Create New Data Source screen.
Search WWH ::




Custom Search