Java Code Examples for org.postgresql.ds.PGPoolingDataSource#setInitialConnections()
The following examples show how to use
org.postgresql.ds.PGPoolingDataSource#setInitialConnections() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Chapter06Database01.java From Java-11-Cookbook-Second-Edition with MIT License | 5 votes |
private static Connection getDbConnection(){ PGPoolingDataSource source = new PGPoolingDataSource(); source.setServerName("localhost"); source.setDatabaseName("cookbook"); source.setInitialConnections(3); source.setMaxConnections(10); source.setLoginTimeout(10); try { return source.getConnection(); } catch(Exception ex) { ex.printStackTrace(); return null; } }
Example 2
Source File: Chapter06Database02.java From Java-11-Cookbook-Second-Edition with MIT License | 5 votes |
private static Connection getDbConnection(){ PGPoolingDataSource source = new PGPoolingDataSource(); source.setServerName("localhost"); source.setDatabaseName("cookbook"); source.setInitialConnections(3); source.setMaxConnections(10); source.setLoginTimeout(10); try { return source.getConnection(); } catch(Exception ex) { ex.printStackTrace(); return null; } }
Example 3
Source File: Chapter06Database01.java From Java-9-Cookbook with MIT License | 5 votes |
private static Connection getDbConnection(){ PGPoolingDataSource source = new PGPoolingDataSource(); source.setServerName("localhost"); source.setDatabaseName("cookbook"); source.setInitialConnections(3); source.setMaxConnections(10); source.setLoginTimeout(10); try { return source.getConnection(); } catch(Exception ex) { ex.printStackTrace(); return null; } }
Example 4
Source File: Chapter06Database02.java From Java-9-Cookbook with MIT License | 5 votes |
private static Connection getDbConnection(){ PGPoolingDataSource source = new PGPoolingDataSource(); source.setServerName("localhost"); source.setDatabaseName("cookbook"); source.setInitialConnections(3); source.setMaxConnections(10); source.setLoginTimeout(10); try { return source.getConnection(); } catch(Exception ex) { ex.printStackTrace(); return null; } }
Example 5
Source File: DbRelatedMethodsTest.java From Java-9-Cookbook with MIT License | 5 votes |
private static Connection getDbConnection(){ PGPoolingDataSource source = new PGPoolingDataSource(); source.setServerName("localhost"); source.setDatabaseName("cookbook"); source.setInitialConnections(3); source.setMaxConnections(10); source.setLoginTimeout(10); try { return source.getConnection(); } catch(Exception ex) { ex.printStackTrace(); return null; } }
Example 6
Source File: DbRelatedMethodsTest.java From Java-9-Cookbook with MIT License | 5 votes |
private Connection getDbConnection(){ PGPoolingDataSource source = new PGPoolingDataSource(); source.setServerName("localhost"); source.setDatabaseName("cookbook"); source.setInitialConnections(3); source.setMaxConnections(10); source.setLoginTimeout(10); try { return source.getConnection(); } catch(Exception ex) { ex.printStackTrace(); return null; } }