JDBC is an API that allows Java applications to be connected and to query a wide range of databases simultaneously.
For example, this includes Java DB, Oracle, MySQL, PostgreSQL, DB2, Sybase ASE, and Microsoft SQL Server.
The full form of JDBC is ” Java Database Connectivity .” JDBC makes it possible for a software developer to run SQL queries in a Java application.
These database connections and query translations of any kind are handled by the JDBC driver. For example, the same Java method can be used to query a MySQL database and a Microsoft SQL Server database.
The goal in this is how to help the developers to get the ” write once, run anywhere ” functionality, which is helpful to help them to work in different types of databases.
If an application wants to use JDBC, then it is very important to install the appropriate driver.
For example, the JDBC Thin driver and the JDBC OCI (Oracle Call Interface) driver. There are driver files available on the Java archives (.JAR files), which are referenced by a Java application.
Each Java archive contains .CLASS files that allow Java apps to communicate with different types of databases. At the same time, individual classes can be removed, so that the need for disk space can be reduced by those related Java apps.
JDBC drivers are maintained and provided by Oracle, which took over the development of Java when it acquired Sun Microsystems in 2010.
What is the difference between JDBC and ODBC?
JDBC is designed specifically for Java applications, while ODBC is language independent. This means that the ODBC API is available in multiple programming languages, while JDBC is only available for Java.
A ” bridge ” can be used to translate commands between two APIs.
For example, an ODBC-JDBC bridge translates ODBC function-calls into JDBC method-calls, which allows them to be processed via a JDBC driver.
While a JDBC-ODBC driver converts JDBC method calls into ODBC function calls, it allows them to work with an ODBC driver.