Multiple choice technology architecture

Which packages contain the JDBC classes?

  1. java.jdbc and javax.jdbc

  2. java.jdbc and java.jdbc.sql

  3. java.sql and javax.sql

  4. java.rdb and javax.rdb

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

JDBC core classes are in java.sql package. Extended JDBC API (for connection pooling, distributed transactions) is in javax.sql. There are no java.jdbc or java.rdb packages.

AI explanation

To answer this question, we need to understand which packages contain the JDBC (Java Database Connectivity) classes.

Option A) java.jdbc and javax.jdbc - This option is incorrect because these packages do not exist in the Java API.

Option B) java.jdbc and java.jdbc.sql - This option is incorrect because the package java.jdbc.sql does not exist in the Java API.

Option C) java.sql and javax.sql - This option is correct because the JDBC classes are located in the java.sql and javax.sql packages. These packages provide the necessary classes and interfaces for connecting to and working with databases using Java.

Option D) java.rdb and javax.rdb - This option is incorrect because these packages do not exist in the Java API.

Therefore, the correct answer is option C. The java.sql and javax.sql packages contain the JDBC classes.