What is, in terms of JDBC, a DataSource?

  1. O (a) A DataSource is the basic service for managing a set of JDBC drivers

  2. O (b) A DataSource is the Java representation of a physical data source

  3. O (c) A DataSource is a registry point for JNDI-services

  4. O (d) A DataSource is a factory of connections to a physical data source


Correct Option: D

AI Explanation

To answer this question, you need to understand the concept of a DataSource in terms of JDBC.

Option A) A DataSource is the basic service for managing a set of JDBC drivers - This option is incorrect. Although a DataSource is used to manage JDBC drivers, it is not the basic service for managing them.

Option B) A DataSource is the Java representation of a physical data source - This option is incorrect. Although a DataSource is a representation of a physical data source, it is not the Java representation of it.

Option C) A DataSource is a registry point for JNDI-services - This option is incorrect. Although a DataSource can be registered in the Java Naming and Directory Interface (JNDI) registry, it is not specifically a registry point for JNDI-services.

Option D) A DataSource is a factory of connections to a physical data source - This option is correct. A DataSource in terms of JDBC is a factory that provides connections to a physical data source. It manages the creation, pooling, and recycling of connections to the database.

The correct answer is Option D. This option is correct because it accurately describes the role of a DataSource in JDBC.

Find more quizzes: