That must not be a checked exception, as I do not imagine any possible recovering mechanism from this situation. This is called (at least in the EJB spec) a system exception.
JPA : Checked exception to verify Database connection
-
29-09-2022 - |
Pergunta
I use JPA, with datasource configured in a persistence.xml file.
What is the exception that I must throw (Checked Exception) if the database name doesnt exist anymore after deploying the application or password wrong because it has been changed after deploying ( generally Database connection failure) ?
Because I don't succeed in catching it by the exception PersistenceException in my java project...
Thank you a lot.
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow