What is JDBC
JDBC is the Java owned java developed API alternative to the ODBC. JDBC is Java Database Connectors. JDBC allows java programs to connect to any database, Native Java developers who are not comfortable using an ODBC in their java programs could go for a JDBC connection to perform the call to the database from their code.
A JDBC could set up a connection with the database, send the SQL statements from the java application and even process the SQL results for the application. Java being a secured and robust coding environment lets you securely work on the database using the JDBC API Calls from the java program.
The JDBC API provides a JDBC-ODBC bridge to connect to the database via an ODBC driver from the java code whenever a JDBC connection would not work. JDBC defines the java interfaces and classes a programmer would use to connect to a DBMS. There are four types of JDBC drivers:
• Type 1 – JDBC-ODBC plus ODBC driver
Translates the JDBC API call into the Microsoft ODBC commands and these commands are then passed to the ODBC drivers. But for this driver to work the ODBC binary code must be loaded in the client computer.
• Type 2 – Native-API, partly Java driver
Translates JDBC API calls to the ODBC API calls; the client computer needs to have the binary code of the ODBC.
• Type 3 – JDBC-Net pure Java driver
JDBC API calls are sent to the middle tier net server which converts the calls in the DBMS specific network protocols. These translated calls are sent to the specific DBMS.
• Type 4 – Native-protocol pure Java driver
Converts the JDBC API calls into DBMS network protocols; there is no middle tier server.
Why a Java based JDBC when there is a Microsoft ODBC?• ODBC from Microsoft is written in C language, Calls from Java to C language is not that secure, not easy to implement and not even portable.
• ODBC uses more pointer concepts where java doesn’t have any pointer concept, so literal conversion of an ODBC API to Java is not desired.
• Hence a Java JDBC was required to enable a pure java solution. ODBC needs to be manually installed in each and every machine but Java developed code for JDBC is portable and automatic to install.
Related posts:
- What is ODBC What is ODBC ? ODBC abbreviation for Open Database Connectivity...
- Get MySQL ODBC Driver MySQL provides standards based ODBC drivers for all programmers to...
- Where can i get ODBC driver ODBC is the Open Database Connectivity software component which requires...
- What is DSN What is DSN ? DSN stands for Data Source Name....
- Oracle ODBC Driver ODBC is the industry standard way to connect to SQL...
No Responses to “What is JDBC”
No feedback yet.