There is no fixed and easy to remember rule that tells you whether
you should use a checked or an unchecked exception. Have a look at what
this tutorial page has to say about it:
The Java Tutorials wrote:
The first kind of exception is the checked exception. These are exceptional conditions that a well-written application should anticipate and recover from. ...
The third kind of exception is the runtime exception. These are exceptional conditions that are internal to the application, and that the application usually cannot anticipate or recover from. These usually indicate programming bugs, such as logic errors or improper use of an API.
You have to decide for yourself which of these is most appropriate in your case.
Note that the standard
Java library itself isn't really consistent with regard to this. Some parts of the library throw checked exceptions, that had probably better be defined as unchecked exceptions (one example that comes to mind is the XML parsing package - javax.xml.parsers.ParserConfigurationException is a checked exception, but it should have been an unchecked exception in my opinion).
Some people even think that the whole idea of checked exceptions is wrong and that Java shouldn't have had this whole concept in the first place.
So, there are no exact answers to this question.