Skip to content

Commit

Permalink
GH-37899: [Java][Doc] Improve JDBC driver documentation
Browse files Browse the repository at this point in the history
- Correct the user property.
- Correct the default for useEncryption.
- Elaborate on using the Properties object when connecting
and describe the order of precedence.
- Mention URI-encoding of option values.
  • Loading branch information
jduo committed Oct 26, 2023
1 parent 57f643c commit 8aa7b18
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions docs/source/java/flight_sql_jdbc_driver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,20 @@ parameters are:
- When TLS is enabled, the password for the certificate store

* - useEncryption
- false
- Whether to use TLS (the default is an insecure, plaintext
connection)
- true
- Whether to use TLS (the default is an encrypted connection)

* - username
* - user
- null
- The username for user/password authentication

* - useSystemTrustStore
- true
- When TLS is enabled, whether to use the system certificate store

Note that URI values must be URI-encoded if they contain characters such
as !, @, $, etc.

Any URI parameters that are not handled by the driver are passed to
the Flight SQL service as gRPC headers. For example, the following URI ::

Expand All @@ -135,3 +137,14 @@ the Flight SQL service as gRPC headers. For example, the following URI ::
This will connect without authentication or encryption, to a Flight
SQL service running on ``localhost`` on port 12345. Each request will
also include a `database=mydb` gRPC header.

Connection parameters may also be supplied using the Properties object
when using the JDBC Driver Manager to connect. When supplying using
the Properties object, values should *not* be URI-encoded.

Parameters specified by the URI supercede parameters supplied by the
Properties object. When calling the `user/password overload of
DriverManager#getConnection()
<https://docs.oracle.com/javase/8/docs/api/java/sql/DriverManager.html#getConnection-java.lang.String-java.lang.String-java.lang.String->`_,
the username and password supplied on the URI supercede the username and
password arguments to the function call.

0 comments on commit 8aa7b18

Please sign in to comment.