DBMS Module 3
DBMS Module 3
What is JDBC?
JDBC stands for Java Database Connectivity, which is a
standard Java API for database-independent connectivity
between the Java programming language and a wide range
of databases.
• The JDBC library includes APIs for each of the tasks
mentioned below that are commonly associated with
database usage.
• Making a connection to a database.
• Creating SQL or MySQL statements.
• Executing SQL or MySQL queries in the database.
• Viewing & Modifying the resulting records
Common JDBC Components
• The JDBC API provides the following interfaces and classes
• DriverManager: This class manages a list of database
drivers. Matches connection requests from the java
application with the proper database driver using
communication sub protocol.
• The first driver that recognizes a certain subprotocol under
JDBC will be used to establish a database Connection.
• Driver: This interface handles the communications with the
database server. You will interact directly with Driver
objects very rarely.
• Instead, you use DriverManager objects, which manages
objects of this type. It also abstracts the details associated
with working with Driver objects.
• Connection: This interface with all methods for contacting a
database. The connection object represents communication
context, i.e., all communication with database is through
connection object only.