Under JDBC, which of the following types of instances can be created by the Connection object?

  1. PreparedStatement

  2. CallableStatement

  3. Statement

  4. SQLStatement

  5. AB&C


Correct Option: E

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) PreparedStatement - This option is correct. The Connection object in JDBC can create instances of PreparedStatement. PreparedStatement is used to execute parameterized SQL queries and provides better performance and security compared to Statement.

Option B) CallableStatement - This option is correct. The Connection object in JDBC can create instances of CallableStatement. CallableStatement is used to execute stored procedures in the database.

Option C) Statement - This option is correct. The Connection object in JDBC can create instances of Statement. Statement is used to execute simple SQL queries.

Option D) SQLStatement - This option is incorrect. SQLStatement is not a valid class or interface in JDBC.

Based on the explanations above, the correct answer is E) AB&C. The Connection object in JDBC can create instances of PreparedStatement, CallableStatement, and Statement.

Find more quizzes: