iGET

Java Programming - MCQ Practice Questions

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

951 questions | 100% Free

Q.661Medium

What is the difference between execute() and executeUpdate() methods?

Q.662Medium

Which statement should be used when you need to retrieve column information without executing multiple queries?

Q.663Medium

What happens if you call next() on a ResultSet after the last row?

Q.664Hard

Consider a scenario: A developer uses Statement with user input directly in SQL queries. What is the primary risk?

Q.665Hard

In a JDBC application, when using transactions with setAutoCommit(false), what happens to intermediate savepoints if rollback() is called?

Q.666Hard

Which JDBC feature should be used for executing multiple SQL statements in a batch for optimal performance?

Q.667Hard

In JDBC, what is the significance of setting FetchSize on a Statement when dealing with large ResultSets?

Q.668Hard

When using JDBC with Spring Framework in 2024-25, which approach is recommended for resource management?

Q.669Easy

Which interface in JDBC is used to execute parameterized queries and prevent SQL injection attacks?

Q.670Easy

What is the correct sequence to establish a JDBC connection in Java?

Q.671Easy

Which method of Connection interface is used to start a transaction in JDBC?

Q.672Easy

In JDBC, what does the BatchUpdate feature allow developers to do?

Q.673Medium

Which JDBC driver type is considered the most portable across different databases?

Q.674Medium

A developer needs to execute a query that returns multiple result sets. Which Statement type should be used?

Q.675Medium

What is the purpose of Connection pooling in JDBC applications?

Q.676Medium

Consider a scenario where a developer uses getConnection() without closing it. What is the potential impact?

Q.677Easy

Which exception is thrown when a JDBC driver is not found in the classpath?

Q.678Medium

What does the setMaxRows() method in Statement do?

Q.679Medium

In a multi-threaded JDBC application, what should be the approach for Connection object usage?

Q.680Medium

Which method in ResultSet is used to check if a column value is NULL?