PostgreSQL includes one implementation
of ConnectionPoolDataSource named
org.postgresql.ds.PGConnectionPoolDataSource.
JDBC requires that a
ConnectionPoolDataSource be configured via
JavaBean properties, shown in Table 1,
so there are get and set methods for each of these properties.
Table 1. ConnectionPoolDataSource Configuration Properties
| Property | Type | Description |
|---|
| serverName | String | PostgreSQL database server
host name |
| databaseName | String | PostgreSQL database name |
| portNumber | int |
TCP port which the PostgreSQL
database server is listening on (or 0 to use the default port)
|
| user | String | User used to make database connections |
| password | String | Password used to make database connections |
| ssl | boolean |
If true, use SSL encrypted connections
(default false)
|
| sslfactory | String |
Custom javax.net.ssl.SSLSocketFactory
class name (see the Section called Custom SSLSocketFactory in the Chapter called Using SSL)
|
| defaultAutoCommit | boolean |
Whether connections should have autocommit enabled or disabled
when they are supplied to the caller. The default is
false, to disable autocommit.
|
Many application servers use a properties-style syntax to
configure these properties, so it would not be unusual to enter
properties as a block of text. If the application server provides
a single area to enter all the properties, they might be listed
like this:
serverName=localhost
databaseName=test
user=testuser
password=testpassword
|
Or, if semicolons are used as separators instead of newlines, it
could look like this:
serverName=localhost;databaseName=test;user=testuser;password=testpassword
|