Get in to the domain of advanced java. Get a good knowledge of Java Database Connectivity (JDBC).
Java Database Connectivity (JDBC) is a Java API which is used to connect and execute query to the database.
API stands for Application programming interface which is a document which contains a description of all the features of a product (software).
It shows classes and interfaces that software programs can follow to communicate with each other. An application programming interface (API) can be created for applications, libraries, operating systems etc.
That JDBC API uses Java Database Connectivity drivers to connect to the database.
The Java Database Connectivity API can access any kind of tabular data, mainly data stored in a Relational Database.
Java Database Connectivity (JDBC) works with Java on various platforms, such as Windows, Mac OS, and the various versions of UNIX.
JDBC provides a complete set of interfaces that allows for portable access to a basic database.
JDBC provides the same efficiency as ODBC which allowing Java programs to contain database independent code.
The JDBC library consists of APIs for each of the tasks commonly associated with database usage:
Making or creating a connection to a database
Creating SQL or MySQL statements
Executing that SQL or MySQL queries in the database
Viewing & Modifying the resulting records
Java Database Connectivity (JDBC) Architecture:-
The JDBC API supports two processing models namely two-tier and three-tier for database access. But in general, JDBC Architecture consists of two layers:
i) JDBC API: This provides the application to JDBC Manager Connection.
ii) JDBC Driver API: This supports the JDBC Manager to Driver Connection.
The JDBC API use a driver manager and database specific drivers to give transparent connectivity to heterogeneous databases.
The JDBC driver manager assures that the correct driver is used to access each and every data source.
The driver manager is proficient in supporting multiple concurrent drivers connected to multiple different databases.
Java Database Connectivity (JDBC) drivers are of 4 types-
1) JDBC-ODBC bridge driver
2) Native-API driver or partially-java driver
3) Network protocol driver or fully-java driver
4) Thin driver or fully-java driver
Why is JDBC Training required?
Java Database Connectivity (JDBC) is a Java API which is used to connect and execute a query to the database. It uses JDBC drivers to connect to the database.
We know that before JDBC, ODBC API was used to connect and execute a query to the database. But ODBC API uses ODBC driver which is written in C language that is platform dependent and unsecured. That is why Sun Microsystem has defined its own API (JDBC API) which uses JDBC driver written in Java language.
JDBC grants multiple implementations to exist and is used by the same application. The API gives a mechanism for dynamically loading the correct Java packages and registering them with the JDBC Driver Manager.
For creating JDBC connections, the Driver Manager is used as a connection factory.
JDBC connections support to create and execute statements.
Also, it(JDBC) allows a Java Program to issue SQL statement and process the results.