iGET

Java Programming - MCQ Practice Questions

Practice free Java Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

958 questions | 100% Free

Q.41Easy

What does the DriverManager.getConnection() method return?

Q.42Easy

In JDBC, which exception is thrown when the database driver class is not found?

Q.43Easy

What is the purpose of the Connection.commit() method in JDBC?

Q.44Medium

Which JDBC method is used to retrieve metadata information about the database?

Q.45Medium

In a JDBC batch operation, what does executeBatch() return?

Q.46Medium

What is the difference between ResultSet.TYPE_SCROLL_INSENSITIVE and ResultSet.TYPE_SCROLL_SENSITIVE?

Q.47Medium

Which JDBC method is used to set an input parameter in a PreparedStatement?

Q.48Medium

What happens when Connection.setAutoCommit(false) is called in JDBC?

Q.49Medium

In JDBC, what is the purpose of the ResultSetMetaData interface?

Q.50Medium

Which JDBC constant specifies read-only access for a ResultSet?

Q.51Medium

What is Connection pooling in JDBC and why is it used?

Q.52Medium

In JDBC, what is the purpose of CallableStatement?

Q.53Hard

A developer creates a JDBC connection but forgets to close it. What might be the consequence?

Q.54Hard

Consider a scenario where a developer retrieves a ResultSet and then closes the Statement object. What happens to the ResultSet?

Q.55Hard

What is the optimal approach to handle JDBC resources to prevent memory leaks in a production application?

Q.56Hard

In a multi-threaded JDBC application, why should each thread have its own Connection object?

Q.57Easy

Which interface in JDBC is used to execute SQL queries and retrieve results?

Q.58Easy

Which JDBC API is used to execute parameterized queries safely?

Q.59Easy

What is the correct syntax to load a JDBC driver in Java?

Q.60Easy

Which method is used to retrieve the next row from a ResultSet?