I have Java class which implements the Database(Postgres) related functionality.
The problem is if Database stopped and then restart then My this class throws SQLException as connection got reset(database is up and running).
Is there any way that after Database restarted; my class automatically Connection to database and work as expected instead of throwing SQLException.
Is there anyway with Properties as a parameter to DriverManager.getConnection().
Thanks and Regards,
Manoj Palhade
It really isn't that simple. What happens if the database never comes back? This is why the application has to handle this. It should be trivial for you write a wrapper that retries intelligently to reconnect.