Which package contains the JDBC API?

Java MCQ: Which package contains the JDBC API?

a) java.sql
b) javax.jdbc
c) java.database
d) javax.sql

Answer:

a) java.sql

Explanation:

The java.sql package contains the JDBC API. This package provides the necessary classes and interfaces for connecting to databases, executing SQL queries, and processing the results. Some of the key classes and interfaces in java.sql include Connection, Statement, PreparedStatement, ResultSet, and DriverManager.

In addition to java.sql, the javax.sql package provides additional classes and interfaces for advanced JDBC features like connection pooling and distributed transactions.

Reference links:

https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top