AJP MCQ Unit 5
AJP MCQ Unit 5
AJP MCQ Unit 5
Answer: _____________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
5. Which of the following methods is used to close a database
connection?
A. close() B. disconnect()
C. release() D. All of the above
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
10. Which of the following methods is used to rollback a
transaction?
A. commit() B. endTransaction()
C. rollback() D. None of the above
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
20. Which of the following is a database trigger?
A. A named set of SQL statements that can be executed as a single unit
B. A named set of SQL statements that returns a value
C. A data rule that is used to ensure the accuracy and consistency of data
D. A named set of SQL statements that is executed automatically when a
certain event occurs
Answer: _______________________________________________
21. Which of the following is a JDBC connection pool?
A. A set of database connections that are managed by a pool manager
B. A JDBC driver that provides a more efficient way to manage database
connections
C. A database schema that is optimized for performance
D. None of the above
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
31. Which of the following is a database partitioning technique?
A. Horizontal partitioning B. Vertical partitioning
C. Range partitioning D. All of the above
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
37. Which of the following is a distributed database?
A. A database that is spread across multiple physical servers
B. A database that is managed by a single database management
system
C. A database that is designed to be used by multiple applications
D. All of the above
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
41. Which of the following is a good practice to follow when writing
database queries?
A. Use prepared statements to prevent SQL injection
B. Use appropriate indexes to improve performance
C. Avoid using SELECT * queries
D. All of the above
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
45. Which of the following is a good practice to follow when
designing a distributed database?
A. Use a database partitioning strategy to distribute the data across
multiple servers
B. Use a database replication strategy to keep the data synchronized
across all of the servers
C. Use a database load balancing strategy to distribute the traffic
across all of the servers
D. All of the above
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
53. Which of the following is a database backup and recovery tool?
A. pg_dump B. mysqldump
C. Oracle RMAN D. All of the above
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
63. Which of the following is a benefit of using a database
management system (DBMS)?
A. Data integrity
B. Data security
C. Data accessibility
D. All of the above
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
68. Which of the following is a database table?
A. A logical collection of data B. A physical collection of data
C. A data type D. None of the above
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
73. Which of the following is a database procedure?
A. A named set of SQL statements that can be executed as a single unit
B. A named set of SQL statements that returns a value
C. A data rule that is used to ensure the accuracy and consistency of data
D. None of the above
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
77. Which of the following is a benefit of using a JDBC connection
pool?
A. Improved performance B. Reduced memory usage
C. Improved scalability D. All of the above
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
84. What does JDBC stand for in the context of database interaction
in Java?
A. Java Database Connector B. Java Data Binding Connector
C. Java Database Connectivity D. Java Data Bridge Connector
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
87. What is the role of a PreparedStatement in JDBC?
A. It represents a pre-compiled SQL statement.
B. It stores the result set of a query.
C. It is used for batch processing.
D. It provides metadata about the database.
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
92. What is the primary advantage of using Object-Relational
Mapping (ORM) frameworks like Hibernate in Java?
A. Automatic database schema generation
B. Improved SQL query performance
C. Direct control over JDBC connections
D. Compatibility with NoSQL databases
Answer: _______________________________________________
Answer: _______________________________________________
94. What is the purpose of the Java Persistence API (JPA) in Java
database interaction?
A. To manage database connections
B. To provide a higher-level abstraction for working with databases
C. To optimize SQL queries
D. To create stored procedures
Answer: _______________________________________________
Answer: _______________________________________________
96. What is the role of the EntityManager in JPA?
A. To establish a database connection
B. To manage database transactions
C. To load and persist entities D. To define database tables
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________
Answer: _______________________________________________