Programming MCQs

Top 20 MCQ Questions on the JDBC Fundamentals

Google+ Pinterest LinkedIn Tumblr
This set of MCQ questions on the JDBC fundamentals includes the collection of top 20 multiple-choice questions on fundamentals of Java Database Connectivity(JDBC). It includes MCQ questions on the main objects of the JDBC API, different types of JDBC SQL statements, types of JDBC drivers with the advantages and disadvantages of the different JDBC drivers.

Read Also: 20 Best Multiple-Choice Questions on Java Servlet

1. State whether the following statements about the JDBC are True or False.
i) JDBC is an API that consists of a set of Java classes, interfaces, and exceptions.
ii) JDBC drivers are not available for none of the data sources that use the Microsoft Open Database Connectivity System.
A) i-True, ii-False
B) i-True, ii-True
C) i-False, ii-True
D) i-False, ii-False

2. Which of the following are the advantages of using Java with JDBC.
i) Can be used already installed databases.
ii) Can be used easily at a low cost.
iii) JDBC makes use of pointers.
iv) Can develop in a short period of time.
A) i, ii and iii only
B) i, iii and iv only
C) i, ii and iv only
D) All i, ii, iii and iv

3. Which of the following are the components of the JDBC model.
i) Java application
ii) JDBC driver
iii) Database
A) i and ii only
B) ii and iii only
C) i and iii only
D) All i, ii and iii

4. … are the main interfaces of JDBC API.
i) java.sql.Driver
ii) java.sql.Connection
iii) java.sql.Statement
iv) java.sql.Resultset
A) i, ii and iii only
B) ii, iii and iv only
C) i, ii and iv only
D) All i, ii, iii and iv

5. … are the main objects of the JDBC API.
i) DataSource
ii) Connection
iii) Statement
iv) Resultset
A) i, ii and iii only
B) ii, iii and iv only
C) i, ii and iv only
D) All i, ii, iii and iv

6. A … object is used when an application plans to specify parameters to your SQL queries.
A) statement
B) prepared statement
C) data source
D) parameterized statement

7. State whether the following statements about the main objects of the JDBC API are True or False.
i) A database object is used to establish connections.
ii) An application uses the connection object to create statements.
iii) ExecuteSQL object is used for executing SQL queries.
A) i-True, ii-True, iii-True
B) i-True, ii-False, iii-False
C) i-True, ii-True, iii-False
D) i-False, ii-True, iii-True

8. State whether the following statements about the JDBC-ODBC bridge are True or False.
i) JDBC-ODBC bridge is suitable for large-scale applications.
ii) It doesn’t support all the features of Java.
iii) The user is limited by the functionality of the underlying ODBC driver.
A) i-True, ii-True, iii-True
B) i-True, ii-False, iii-False
C) i-True, ii-True, iii-False
D) i-False, ii-True, iii-True

9. … driver is generally most appropriate when automatic installation and downloading of Java technology application is not important.
A) JDBC – ODBC bridge
B) Native API partly Java technology-enabled driver
C) Native protocol fully Java technology-enabled driver
D) Net protocol fully Java technology-enabled driver

10. … mainly use native API for data access and provide Java wrapper classes to be able to be invoked using JDBC drivers.
A) JDBC – ODBC bridge
B) Native API partly Java technology-enabled driver
C) Native protocol fully Java technology-enabled driver
D) Net protocol fully Java technology-enabled driver

11. State whether the following statements about the net-protocol fully Java technology-enabled driver are True.
i) It can be used when a company has multiple databases and wants to use a single JDBC driver to connect to all of them.
ii) There is no requirement for JDBC driver code on the client machine.
iii) It needs some database-specific code on the middleware server.
A) i and ii only
B) ii and iii only
C) i and iii only
D) All i, ii and iii

12. A … is the fastest JDBC driver among all the JDBC drivers.
A) JDBC – ODBC bridge
B) Native API partly Java technology-enabled driver
C) Native protocol fully Java technology-enabled driver
D) Net protocol fully Java technology-enabled driver

13. State whether the following statements about the JDBC – ODBC bridge driver is True or False.
i) JDBC-ODBC bridge is suitable for large-scale applications.
ii) It doesn’t support all the features of Java.
iii) The user is limited by the functionality of the underlying ODBC driver.
A) i-True, ii-True
B) i-True, ii-False
C) i-False, ii-False
D) i-False, ii-True

14. A … is returned to an application when a SQL query is executed by a statement object.
A) Result
B) ResultSet
C) Data
D) DataResult

15. State whether the following statements about the JDBC drivers are True.
i) To connect with individual databases, JDBC requires drivers for each database.
ii) There are three types of drivers available in Java for database connectivity.
iii) The JDBC – ODBC bridge driver is intended for programmers writing applications.
A) i and ii only
B) ii and iii only
C) i and iii only
D) All i, ii and iii

16. … allows you to execute stored procedures within a RDBMS which supports stored procedures.
A) Java.sql.statement
B) Java.sql.CallableStatement
C) Java.sql.PreparedStatement
D) Java.sql.StoredStatement

17. A … object in JDBC is used to establish connections.
A) Connection
B) DataSource
C) Statement
D) CallableStatement

18. A … object in JDBC controls the connection to the database.
A) Connection
B) DataSource
C) Statement
D) CallableStatement

19. … converts JDBC technology calls into the network protocol used by different DBMS directly.
A) A JDBC – ODBC bridge
B) A native API partly Java technology-enabled driver
C) A native protocol fully Java technology-enabled driver
D) A net protocol fully Java technology-enabled driver

20. … translates JDBC calls into the middleware vendor’s protocol, which is then converted to a database-specific protocol by the middleware server software.
A) A JDBC – ODBC bridge
B) A native API partly Java technology-enabled driver
C) A native protocol fully Java technology-enabled driver
D) A net protocol fully Java technology-enabled driver

Answers:

  1. A) i-True, ii-False
  2. C) i, ii and iv only
  3. D) All i, ii and iii
  4. B) ii, iii and iv only
  5. A) i, ii and iii only
  6. B) prepared statement
  7. C) i-True, ii-True, iii-False
  8. D) i-False, ii-True, iii-True
  9. A) JDBC – ODBC bridge
  10. B) Native API partly Java technology-enabled driver
  11. D) All i, ii and iii
  12. C) Native protocol fully Java technology-enabled driver
  13. A) i-True, ii-True
  14. B) ResultSet
  15. C) i and iii only
  16. B) Java.sql.CallableStatement
  17. B) DataSource
  18. A) Connection
  19. C) A native protocol fully Java technology-enabled driver
  20. D) A net protocol fully Java technology-enabled driver

Avatar for Shuseel Baral

Shuseel Baral is a web programmer and the founder of InfoTechSite has over 8 years of experience in software development, internet, SEO, blogging and marketing digital products and services is passionate about exceeding your expectations.

Write A Comment