24.1. JDBC Concepts and Terminology

To make sure we have a common understanding of the jargon, I'll first take a look at database terminology. First, in general, data access is the process of retrieving or manipulating data that is taken from a remote or local data source. Data sources don't have to be relational—they can come in a variety of different forms. Some common examples of data sources that you might access are:

  • A remote relational database on a server—for example, SQL Server

  • A local relational database on your computer—for example, Personal Oracle or Microsoft Access

  • A text file on your computer

  • A spreadsheet

  • A remote mainframe/midrange host providing data access

  • An online information service (such as a stock market ticker, for example)

JDBC is, by definition, an interface to relational data sources. While it is conceivable that non-relational sources may be accessible through JDBC, you'll be concentrating on relational databases throughout this chapter and the next. If you haven't met relational databases before, you should still be able to follow the discussion. The structure of a relational database is logical and fairly easy to learn, and while I can't provide a comprehensive tutorial on it here, I'll cover enough of the basics to make what you are doing understandable, even if you've never worked with databases before.

The Java Database Connectivity (JDBC) library provides the means for you to execute SQL statements within a Java program to access and operate on a relational ...

Get Ivor Horton's Beginning Java™ 2, JDK™ 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.