1. 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


Correct Option: C

AI Explanation

To answer this question, you need to understand the Java Database Connectivity (JDBC) API and the packages that contain the JDBC classes.

The correct answer is C) java.sql and javax.sql.

Explanation for each option:

Option A) java.jdbc and javax.jdbc - This option is incorrect because there is no package named java.jdbc or javax.jdbc that contains the JDBC classes.

Option B) java.jdbc and java.jdbc.sql - This option is incorrect because there is no package named java.jdbc.sql that contains the JDBC classes.

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

Option D) java.rdb and javax.rdb - This option is incorrect because there is no package named java.rdb or javax.rdb that contains the JDBC classes.

In conclusion, the correct answer is C) java.sql and javax.sql because these packages contain the JDBC classes.

Find more quizzes: