Good suggestion. The underlying exception was already visible in the stacktrace but the message can be improved.

How about using the following catch block in the connect method.

} catch(SQLException e) {
throw e;
} catch(NoSuchElementException e) {
throw new SQLNestedException("Cannot get a connection, pool error: " + e.getMessage(), e);
} catch(RuntimeException e) {
throw e;
} catch(Exception e) {
throw new SQLNestedException("Cannot get a connection, general error: " + e.getMessage(), e);
}



-- Dirk


Meikel Bisping wrote:

Hi,

I tried to establish a ConnectionPool with DBCP to an Informix
Database using your examples.
I always got the exeception "pool exhausted" when trying to open the
first connection.
I eventually found out during debugging that the problem was an older
Informix driver (that is generally still in use, though). It didn't support read-only mode and threw an SQLException even when
calling setReadOnly(false).
It would be helpful for users if in cases like that the actual
exception would be thrown, "pool exhausted" didn't help much.


Cheers,

Meikel Bisping



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to