Skip to content

Commit

Permalink
doc: update documentation to mention custom 'options' connection prop…
Browse files Browse the repository at this point in the history
…erty support

* update README.md and docs/documentation/head/connect.md so that they mention 'options' connection
parameter
  • Loading branch information
Ivan Leskin committed Nov 27, 2018
1 parent af8b6f3 commit 67acab8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ where:
* **host** (Optional) is the server address to connect. This could be a DNS or IP address, or it could be *localhost* or *127.0.0.1* for the local computer. To specify an IPv6 address your must enclose the host parameter with square brackets (jdbc:postgresql://[::1]:5740/accounting). Defaults to `localhost`.
* **port** (Optional) is the port number listening on the host. Defaults to `5432`.
* **database** (Optional) is the database name. Defaults to the same name as the *user name* used in the connection.
* **propertyX** (Optional) is one or more option connection properties. For more information see *Connection properties*.
* **propertyX** (Optional) is one or more option connection properties. For more information see *Connection properties*.

#### Connection Properties
In addition to the standard connection parameters the driver supports a number of additional properties which can be used to specify additional driver behaviour specific to PostgreSQL™. These properties may be specified in either the connection URL or an additional Properties object parameter to DriverManager.getConnection.
Expand All @@ -109,6 +109,7 @@ In addition to the standard connection parameters the driver supports a number o
| ----------------------------- | ------- | :-----: | ------------- |
| user | String | null | The database user on whose behalf the connection is being made. |
| password | String | null | The database user's password. |
| options | String | null | Command-line options to send to the server at connection start. |
| ssl | Boolean | false | Control use of SSL (true value causes SSL to be required) |
| sslfactory | String | null | Provide a SSLSocketFactory class when using SSL. |
| sslfactoryarg (deprecated) | String | null | Argument forwarded to constructor of SSLSocketFactory class. |
Expand Down Expand Up @@ -149,7 +150,7 @@ In addition to the standard connection parameters the driver supports a number o
| preferQueryMode | String | extended | Specifies which mode is used to execute queries to database, possible values: extended, extendedForPrepared, extendedCacheEverything, simple |
| reWriteBatchedInserts | Boolean | false | Enable optimization to rewrite and collapse compatible INSERT statements that are batched. |

## Contributing
## Contributing
For information on how to contribute to the project see the [Contributing Guidelines](CONTRIBUTING.md)

----------------------------------------------------
Expand Down
18 changes: 15 additions & 3 deletions docs/documentation/head/connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ URL or an additional `Properties` object parameter to `DriverManager.getConnecti
The following examples illustrate the use of both methods to establish a SSL
connection.

If a property is specified both in URL and in `Properties` object, the value from
`Properties` object is ignored.

```java
String url = "jdbc:postgresql://localhost/test";
Properties props = new Properties();
Expand All @@ -68,11 +71,20 @@ Connection conn = DriverManager.getConnection(url);

* **user** = String

The database user on whose behalf the connection is being made.
The database user on whose behalf the connection is being made.

* **password** = String

The database user's password.
The database user's password.

* **options** = String

Command-line options to send to the server at connection start.

The value of this property may contain spaces or other special characters,
and it should be properly encoded if provided in the connection URL. Spaces
are considered to separate command-line arguments, unless escaped with
a backslash (`\`); `\\` represents a literal backslash.

* **ssl** = boolean

Expand Down Expand Up @@ -459,4 +471,4 @@ And read pool balances connections between slaves nodes, but allows connections

If a slave fails, all slaves in the list will be tried first. If the case that there are no available slaves
the master will be tried. If all of the servers are marked as "can't connect" in the cache then an attempt
will be made to connect to all of the hosts in the URL in order.
will be made to connect to all of the hosts in the URL in order.

0 comments on commit 67acab8

Please sign in to comment.