DBCP login pool connectionTimeout

According to the DBCP document, BasicDataSource does not support setLoginTimeout (). My question is, how do I set LoginTimeout to create Connection objects? I know that I can set maxWait to the pool, but I understand that this will only be used when the pool is exhausted and you expect the existing connection to be freed. This will not save me from a situation when it is necessary to create a new connection, but the connection / entry into the database freezes.

Any help is appreciated. Thanks.

+8
database oracle apache jdbc connection
source share
1 answer

Well, there is always the option to add the correct URL. Depending on which DB you are using, you can add one of the parameters to the JDBC URL.

Here is a link that confirms that BasicDataSource does not support loginTimeout

And at the bottom of this blog, there is a table listing the URL parameters for connection timeouts.

0
source share

All Articles