Introduction To Java Programming Language
105606Module 6: Introduction to Java Database Connectivity
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
View this question on its own page →JDBC is primarily used for:
(i) Network routing
(ii) Thread synchronization
(iii) Database connectivity
(iv) Graphics programmingWorked SolutionAnswer: (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, andResultSet.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
View this question on its own page →Which JDBC driver type is commonly called the thin driver?
(i) Type 1
(ii) Type 2
(iii) Type 3
(iv) Type 4Worked SolutionAnswer: (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.
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
View this question on its own page →Compare the four types of JDBC drivers with respect to architecture, dependence on native libraries, portability and typical use.
Worked SolutionFour 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.