Unit 1
Unit 1
1.1 Introduction
• JDBC (Java Database Connectivity) is a Java API that allows Java
applications to interact with databases.
• It provides methods to execute SQL queries, retrieve results, and manage
database connections.
• JDBC acts as a bridge between the Java programming language and relational
databases like MySQL, Oracle, or PostgreSQL.
• JDBC enables Java applications to communicate with various relational
databases in a standardized way. It abstracts the complexities of database
operations through a common API.
• As part of the Java platform, JDBC is platform-independent. It works on any
operating system that supports Java.
1.2 JDBC Architecture (Three tier)
1.2 JDBC Architecture (Three tier)
• Application: It is a java applet or a servlet that communicates with a data
source.
• The JDBC API: The JDBC API allows Java programs to execute SQL
statements and retrieve results. Some of the important interfaces defined in
JDBC API are as follows: Driver interface , ResultSet Interface , RowSet
Interface , PreparedStatement interface, Connection interface, and Classes
defined in JDBC API are as follows: DriverManager class, Types class, Blob
class, clob class.
• DriverManager: It plays an important role in the JDBC architecture. It uses
some database-specific drivers to effectively connect enterprise applications to
databases.
• JDBC drivers: To communicate with a data source through JDBC, you need a
JDBC driver that intelligently communicates with the respective data source.