ODBC and JDBC
ODBC (Open Database Connectivity) and JDBC (Java Database Connectivity) serve as APIs for a program to interact with a database server.
In general, the application must make calls to:
connect with the database server
send SQL commands to the database server
fetch tuples of result one-by-one into program variables
ODBC
ODBC works with C, C++, C# and Visual Basic (other APIs such as ADO.NET sit on top of ODBC).
ODBC is the standard for application programs communicating with a database server.
The API will:
open a connection with a database
send queries and updates
get back results
ODBC can be used with applications such as GUIs, spreadsheets etc.
JDBC
JDBC works with Java.
Along with supporting various features for querying and updating data, and for retrieving query results, JDBC also supports metadata retrieval i.e. retrieving information about the database such as relations present in the database and the names and types of relation attributes.
JDBC connects with the database as follows:
open a connection
create a “Statement” object
execute queries using the Statement object to send queries and fetch results
exception mechanism to handle errors
Last updated