Introduction To Java Programming Language

105606
Back to Introduction To Java Programming Language

Module 6: Introduction to Java Database Connectivity

  1. 1(h). JDBC is primarily used for: (i) Network routing (ii) Thread synchronization (iii) Database connectivity (iv) Graphics programming20262m

    Module 6: Introduction to Java Database Connectivity

    JDBC is primarily used for:

    (i) Network routing
    (ii) Thread synchronization
    (iii) Database connectivity
    (iv) Graphics programming

    View this question on its own page →
    Worked Solution

    Answer: (iii) Database connectivity

    JDBC (Java Database Connectivity) is a Java API for connecting to relational databases, executing SQL statements, and processing results using interfaces such as Connection, PreparedStatement, and ResultSet.

  2. 1(j). Which JDBC driver type is commonly called the thin driver? (i) Type 1 (ii) Type 2 (iii) Type 3 (iv) Type 420262m

    Module 6: Introduction to Java Database Connectivity

    Which JDBC driver type is commonly called the thin driver?

    (i) Type 1
    (ii) Type 2
    (iii) Type 3
    (iv) Type 4

    View this question on its own page →
    Worked Solution

    Answer: (iv) Type 4

    A Type 4 JDBC driver (thin driver) translates JDBC calls directly into the database's network protocol. It is generally pure Java and does not require native client libraries.

  3. 8(a). Compare the four types of JDBC drivers with respect to architecture, dependence on native libraries, portability and typical use.20267m

    Module 6: Introduction to Java Database Connectivity

    Compare the four types of JDBC drivers with respect to architecture, dependence on native libraries, portability and typical use.

    View this question on its own page →
    Worked Solution

    Four types of JDBC drivers

    Type Architecture Native dependency Portability
    1: JDBC–ODBC bridge JDBC translated to ODBC ODBC/native layer Low; obsolete/removed from modern JDKs
    2: Native API JDBC translated to vendor native API Yes Requires native library per platform
    3: Network protocol JDBC sent to middleware, translated to DB protocol Usually no client native library Portable, requires middleware
    4: Thin/pure Java JDBC translated directly to database wire protocol No High; needs database-specific driver

    Type 4 is widely used because it is pure Java and communicates directly with the database server. Choose a driver supported by the target database and deployment environment.