Skip to content

Commit b589c96

Browse files
authored
feat: support endpoint connection URL property (#1582)
Added support for an 'endpoint' connection URL property. This property can be added to either the Connection URL or the Properties object that is used to create a Connection, and can be used in combination with the autoConfigEmulator connection property to connect to an emulator instance that uses a randomly assigned port number. See https://github.com/googleapis/java-spanner-jdbc/blob/main/src/test/java/com/google/cloud/spanner/jdbc/ConcurrentTransactionOnEmulatorTest.java for an example on how to use this property.
1 parent 06e43c0 commit b589c96

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/com/google/cloud/spanner/jdbc/JdbcDriver.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@
8484
* instance and database in the connection string will automatically be created if these do
8585
* not yet exist on the emulator. This means that you do not need to execute any `gcloud`
8686
* commands on the emulator to create the instance and database before you can connect to it.
87+
* <li>endpoint (string): Set this property to specify a custom endpoint that the JDBC driver
88+
* should connect to. You can use this property in combination with the autoConfigEmulator
89+
* property to instruct the JDBC driver to connect to an emulator instance that uses a
90+
* randomly assigned port numer. See <a
91+
* href="https://github.com/googleapis/java-spanner-jdbc/blob/main/src/test/java/com/google/cloud/spanner/jdbc/ConcurrentTransactionOnEmulatorTest.java">ConcurrentTransactionOnEmulatorTest</a>
92+
* for a concrete example of how to use this property.
8793
* <li>usePlainText (boolean): Sets whether the JDBC connection should establish an unencrypted
8894
* connection to the server. This option can only be used when connecting to a local emulator
8995
* that does not require an encrypted connection, and that does not require authentication.
@@ -101,8 +107,7 @@
101107
* connection.
102108
* <li>retryAbortsInternally (boolean): Sets the initial retryAbortsInternally mode for the
103109
* connection. Default is true. @see {@link
104-
* com.google.cloud.spanner.jdbc.CloudSpannerJdbcConnection#setRetryAbortsInternally(boolean)}
105-
* for more information.
110+
* CloudSpannerJdbcConnection#setRetryAbortsInternally(boolean)} for more information.
106111
* <li>minSessions (int): Sets the minimum number of sessions in the backing session pool.
107112
* Defaults to 100.
108113
* <li>maxSessions (int): Sets the maximum number of sessions in the backing session pool.

0 commit comments

Comments
 (0)