DEVFYI - Developer Resource - FYI

When an SQL select statement doesn't return any rows, is an SQLException thrown?

JDBC Interview Questions and Answers


(Continued from previous question...)

When an SQL select statement doesn't return any rows, is an SQLException thrown?

No. If you want to throw an exception, you could wrap your SQL related code in a custom class and throw something like ObjectNotFoundException when the returned ResultSet is empty.

(Continued on next question...)

Other Interview Questions