title: How to limit Postgresql jdbc pool connections amount?
body: <p>PostgreSQL JDBC provide several classes for connection pooling. Only <code>PGConnectionPoolDataSource</code> is recommended to use. With this class if received connection is busy, then library creates another one.</p>
  
  <p><code>PGPoolingDataSource</code> (with <code>setMaxConnections</code> called) is waiting until some connection will become free (if all of them busy), that's what I want. But this class is marked as <a href="https://jdbc.postgresql.org/documentation/publicapi/org/postgresql/ds/PGPoolingDataSource.html" rel="nofollow noreferrer">@Deprecated</a>.</p>
  
  <p>At the source code I see it uses <code>PGPooledConnection</code>, those one use <code>BaseDataSource</code> and there is no mention of any limitation. </p>
  
  <p>Is there any correct way to limit pool connections?</p>