JDBC   «Prev  Next»
Lesson 2Enterprise solutions with Java and JDBC
ObjectiveDistinguish the role and place of JDBC among the Java technologies.

Enterprise Soutions with Java and JDBC

The role of JDBC in Java application Development

A database system is at the center of information processing for most enterprises. It is the key piece for managing and storing information about a company's business and is crucial to the operation of a company. Since that is the case, the ability to provide connections to that data is crucial to the usefulness of any serious application development tool. JDBC provides those connections for Java. JDBC was developed to allow Java programmers to use a DBMS that is at the center of an enterprise. The Java technologies are well-suited for developing enterprise solutions.
JDBC is a programming interface for establishing connections to a DBMS and routing requests over that connection. JDBC sits between an application and the data source. The JDBC architecture model is represented in the Slide Show below. The illustration portrays the separation and the interaction between the application(s), JDBC, and the data source(s).
  1. JDBC allows an application to send SQL statements to a database and receive the results.
  2. JDBC interfaces for specific database engines are implemented by a set of classes called JDBC drivers. Since the JDBC driver handles the low-level connection and translation issues, you can focus on the database application development without worrying about the specifics of each database.
  3. The basic sequence of events in a database query is a three-step approach: 1) The client application connects to the database, 2) The client application issues an SQL statement (select), 3) The driver translates the JDBC select statement into the format of the database's proprietary format.
  4. The driver translates the ResultSet returned by the database, which is then returned to the application.
  5. JDBC can be used to connect to any database for which a JDBC driver was written (such as Sybase, Oracle, MySQL, DB2)


Business value of JDBC

The business value of the JDBC architecture is that the Java Virtual Machine allows your applications to access any data source and be executed on any platform. The Java programming language, being object-oriented, places the focus on the object (what) that is being dealt with, rather than the process (how).
Because Java has many powerful capabilities of its own, the combination of database connectivity with the features of Java is a major reason for choosing this set of tools. This will be discussed further in a later lesson.
JDBC should be used when a Java application needs to have access to the database management systems in an organization. It is not designed to read or write files directly on a system. It is also not designed to manage network communications with remote systems. It may use those facilities indirectly, which will be discussed in detail later in this course.
In the next lesson, we will have a quick overview of database systems.