문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top