From 8aa7b185946d0544accc65359fc2899d056a4b94 Mon Sep 17 00:00:00 2001 From: James Duong Date: Wed, 25 Oct 2023 16:12:52 -0700 Subject: [PATCH 1/2] GH-37899: [Java][Doc] Improve JDBC driver documentation - 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. --- docs/source/java/flight_sql_jdbc_driver.rst | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/source/java/flight_sql_jdbc_driver.rst b/docs/source/java/flight_sql_jdbc_driver.rst index 3b45cdd8b84..3f5b4ac00f9 100644 --- a/docs/source/java/flight_sql_jdbc_driver.rst +++ b/docs/source/java/flight_sql_jdbc_driver.rst @@ -115,11 +115,10 @@ 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 @@ -127,6 +126,9 @@ parameters are: - 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 :: @@ -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() +`_, +the username and password supplied on the URI supercede the username and +password arguments to the function call. From f3c3c3ac75fbbc7ff49635a8a396c5e932e6de27 Mon Sep 17 00:00:00 2001 From: James Duong Date: Fri, 27 Oct 2023 14:27:22 -0700 Subject: [PATCH 2/2] Note that property names are case-sensitive --- docs/source/java/flight_sql_jdbc_driver.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/java/flight_sql_jdbc_driver.rst b/docs/source/java/flight_sql_jdbc_driver.rst index 3f5b4ac00f9..82682423024 100644 --- a/docs/source/java/flight_sql_jdbc_driver.rst +++ b/docs/source/java/flight_sql_jdbc_driver.rst @@ -80,8 +80,8 @@ The components of the URI are as follows. * **HOSTNAME** is the hostname of the Flight SQL service. * **PORT** is the port of the Flight SQL service. -Additional options can be passed as query parameters. The supported -parameters are: +Additional options can be passed as query parameters. Parameter names are +case-sensitive. The supported parameters are: .. list-table:: :header-rows: 1