What is type 1,2,3 or 4 of a JDBC Driver?

前端 未结 5 574
终归单人心
终归单人心 2020-12-28 16:45

To connect to a database using Java, most of us use JDBC API.

We normally include driver like ojdbc14 (Intended for Java 1.4) in class path, and in pro

5条回答
  •  执笔经年
    2020-12-28 17:16

    In simple terms

    Type1:(JDBC-ODBC Bridge driver)

    ->it uses ODBC

    ->converts JDBC calls into ODBC calls

    ->its disadvantages are you need to install ODBC or you can say it depends on ODBC(given by microsoft)

    ->its performance is low because it converts JDBC calls into ODBC calls

    Type2(Native API)

    ->uses client side libraries of database

    ->converts JDBC calls into native calls of the database Api

    ->gives better performance than JDBC-ODBC(Type1) because it does not depends or it does not use ODBC

    Type3(Network Protocol)

    ->it uses Application Server(Middleware)

    ->server converts the jdbc calls into vendor specific database protocol

    ->Network support is required on client side

    ->Maintenance of Network Protocol driver becomes costly

    Type4(Thin)

    ->interacts dierectly with database

    ->does not require any libraries

    ->written by database vendors ,hence they are best to use

提交回复
热议问题