According to MJB, setting the c3p0 configuration parameter to get RetryAttempts to 1 will cause clients to simply throw an exception when the connection fails, rather than wait and retry.
If you want the c3p0 connection pool to never try to connect to the database after a round of failure crashes (with the "round" determined by the RetryAttempts retrieval method), set breakAfterAcquireFailure to true. (By default, this is false, c3p0 will try to connect to Connections again when new clients appear.)
http://www.mchange.com/projects/c3p0/#acquireRetryAttempts
http://www.mchange.com/projects/c3p0/#breakAfterAcquireFailure
source share