Java Reference
In-Depth Information
Java Database Connectivity
Java Database Connectivity (JDBC) is a set of classes that can be used to develop
client/server applications that work with databases developed by Microsoft, Sybase,
Oracle, Informix, and other sources.
With JDBC, you can use the same methods and classes in Java programs to read and
write records and perform other kinds of database access. A class called a driver acts as a
bridge to the database source—there are drivers for each of the popular databases.
Client/server software connects a user of information with a provider of that information,
and it's one of the most commonplace forms of programming. You use it every time you
surf the Web: A web browser client requests pages, image files, and other documents
using a uniform resource locator, or URL. Web servers provide the requested informa-
tion, if it can be found, for the client.
One of the biggest obstacles faced by database programmers is the wide variety of data-
base formats in use, each with its own proprietary method of accessing data.
To simplify using relational database programs, a standard language called SQL
(Structured Query Language) has been introduced. This language supplants the need to
learn different database-querying languages for each database format. Java DB, the data-
base included in Java 6, supports SQL.
In database programming, a request for records in a database is called a query . Using
SQL, you can send complex queries to a database and get the records you're looking for
in any order you specify.
Consider the example of a database programmer at a student loan company who has been
asked to prepare a report on the most delinquent loan recipients. The programmer could
use SQL to query a database for all records in which the last payment was more than 180
days ago and the amount due is more than $0.00. SQL also can be used to control the
order in which records are returned, so the programmer can get the records in the order
of Social Security number, recipient name, amount owed, or another field in the loan
database.
All this is possible with SQL—the programmer doesn't need any of the proprietary lan-
guages associated with popular database formats.
SQL is strongly supported by many database formats, so, in the-
ory, you should be able to use the same SQL commands for each
database tool that supports the language. However, you will still
need to learn the idiosyncrasies of a specific database format
when accessing it through SQL.
CAUTION
 
Search WWH ::




Custom Search