JDBC
Stands for "Java Database Connectivity." JDBC is an API that allows Java applications to connect to and query a wide range of databases. Examples include Java DB, Oracle, MySQL, PostgreSQL, DB2, Sybase ASE, and Microsoft SQL Server.
JDBC makes it possible for a software developer to run SQL queries within a Java application. The database connection and any required query translations 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 is to provide developers with "write once, run anywhere" functionality, making it easy to work with different types of databases.
In order for an application to use JDBC, the appropriate driver must be installed. Examples include the JDBC Thin driver and the JDBC OCI (Oracle Call Interface) driver. The driver files are available as Java archives (.JAR files), which can be referenced by a Java application. Each Java archive contains .CLASS files that allow Java apps to communicate with different types of databases. Individual classes can be removed to reduce the disk space required by the corresponding Java app.
What is the difference between JDBC and ODBC?
JDBC is designed specifically for Java applications, while ODBC is language independent. That means the ODBC API is available for multiple programming languages, while JDBC is only available for Java. A "bridge" can be used to translate commands between the two APIs. For example, an ODBC-JDBC bridge translates ODBC function-calls into JDBC method-calls, allowing them to be processed by a JDBC driver. A JDBC-ODBC driver converts JDBC method calls into ODBC function calls, allowing them to work with an ODBC driver.