Ecj Unit-1
Ecj Unit-1
to connect and execute the query with the database. It is a part of JavaSE (Java Standard Edition). JDBC
API uses JDBC drivers to connect with the database. There are four types of JDBC drivers:
Native Driver,
Thin Driver
We can use JDBC API to access tabular data stored in any relational database. By the help of JDBC API,
we can save, update, delete and fetch data from the database. It is like Open Database Connectivity
(ODBC) provided by Microsoft.
The current version of JDBC is 4.3. It is the stable release since 21st September, 2017. It is based on the
X/Open SQL Call Level Interface. The java.sql package contains classes and interfaces for JDBC API. A list
of popular interfaces of JDBC API are given below:
Driver interface
Connection interface
Statement interface
DriverManager class
Blob class
Clob class
Types class
Before JDBC, ODBC API was the database API to connect and execute the query with the database. But,
ODBC API uses ODBC driver which is written in C language (i.e. platform dependent and unsecured).
That is why Java has defined its own API (JDBC API) that uses JDBC drivers (written in Java language).
We can use JDBC API to handle database using Java program and can perform the following activities:
What Is API?
Application Programming Interface
=====================================================================================
Database Driver in jdbc.
A database driver is a computer program that implements a protocol (ODBC or JDBC) for a database
connection. The driver works . ... To connect with individual databases.
JDBC Driver is a software component that enables java application to interact with the database.
Advantages:
easy to use.
can be easily connected to any database.
Disadvantages:
because JDBC method call is converted into the ODBC function calls.
2) Native-API driver
The Native API driver uses the client-side libraries of the database. The driver converts JDBC method
calls into native calls of the database API.
Advantage:
performance upgraded than JDBC-ODBC bridge driver.
Disadvantage :
Advantage:
No client side library is required of application server like auditing, load balancing, logging etc.
Disadvantages:
Network support is required on client machine.
Advantage:
Better performance than all other drivers.
Disadvantage:
Drivers depend on the Database.