I have an application that is deployed on tomcat on server A and sends queries to a huge variety of SQL Server databases on an server B.

I am concerned that my application could overload this SQL Server database server and would like some way to preventing it making requests to connect to any database on that server if some arbitrary number of connections were already in existence and unclosed.

I am looking at using connection pooling but am under the impression that this will only pool connections to a specific database on the SQL Server server, I want to control the total of these combined connections that will occur to many different databases (incidentally I can only find out the names of individual db's dynamically as they change day to day). Will connection pooling take care of this for me, are am I looking at this from the wrong perspective?

I have no access to the configuration of the SQL Server server.

Links to tutorials or working examples of your suggested solution are most welcome!