Skip to content

Commit 4a9ddb2

Browse files
committed
Merge branch 'main' into PR #2113 to update
2 parents 6c82188 + 155feb4 commit 4a9ddb2

File tree

13 files changed

+75
-34
lines changed

13 files changed

+75
-34
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog
22

3+
## [2.34.0](https://github.com/googleapis/java-spanner-jdbc/compare/v2.33.3...v2.34.0) (2025-11-18)
4+
5+
6+
### Features
7+
8+
* Add unknownLength connection property ([#2286](https://github.com/googleapis/java-spanner-jdbc/issues/2286)) ([6aceb64](https://github.com/googleapis/java-spanner-jdbc/commit/6aceb6487e46beb45277dee230a66b09e4de1671))
9+
10+
11+
### Dependencies
12+
13+
* Update dependency com.fasterxml.jackson.core:jackson-databind to v2.20.1 ([#2275](https://github.com/googleapis/java-spanner-jdbc/issues/2275)) ([559cdee](https://github.com/googleapis/java-spanner-jdbc/commit/559cdee7633ae508f857890770f173ac2f18d2ca))
14+
* Update dependency com.google.api.grpc:proto-google-cloud-trace-v1 to v2.79.0 ([#2281](https://github.com/googleapis/java-spanner-jdbc/issues/2281)) ([3a15afa](https://github.com/googleapis/java-spanner-jdbc/commit/3a15afa13b1583e0941a909ac09acac49c532a36))
15+
* Update dependency com.google.api.grpc:proto-google-cloud-trace-v1 to v2.80.0 ([#2288](https://github.com/googleapis/java-spanner-jdbc/issues/2288)) ([b859d8e](https://github.com/googleapis/java-spanner-jdbc/commit/b859d8e07ae7d9e3f71d431cc16cfa1e4b9fb2e4))
16+
* Update dependency com.google.cloud:google-cloud-spanner to v6.103.0 ([#2291](https://github.com/googleapis/java-spanner-jdbc/issues/2291)) ([226850e](https://github.com/googleapis/java-spanner-jdbc/commit/226850edd1ba3d85a762872abcb70bad836b3ca1))
17+
* Update dependency com.google.cloud:google-cloud-spanner-bom to v6.103.0 ([#2292](https://github.com/googleapis/java-spanner-jdbc/issues/2292)) ([1213da6](https://github.com/googleapis/java-spanner-jdbc/commit/1213da65f745b88babe6dc2d3805534b47b34bd6))
18+
* Update dependency com.google.cloud:google-cloud-trace to v2.79.0 ([#2282](https://github.com/googleapis/java-spanner-jdbc/issues/2282)) ([ebbb0de](https://github.com/googleapis/java-spanner-jdbc/commit/ebbb0deb3e7c1e7f564a9a1a792ecba336d5fcb0))
19+
* Update dependency com.google.cloud:google-cloud-trace to v2.80.0 ([#2289](https://github.com/googleapis/java-spanner-jdbc/issues/2289)) ([d64f6c6](https://github.com/googleapis/java-spanner-jdbc/commit/d64f6c6adb2f17b53acda3006aff9dc2aabb4dfc))
20+
* Update dependency com.google.cloud:sdk-platform-java-config to v3.54.1 ([#2277](https://github.com/googleapis/java-spanner-jdbc/issues/2277)) ([7a48db6](https://github.com/googleapis/java-spanner-jdbc/commit/7a48db68cb769246b9307e39e37d8af12641a0fb))
21+
* Update dependency commons-cli:commons-cli to v1.11.0 ([#2283](https://github.com/googleapis/java-spanner-jdbc/issues/2283)) ([7582363](https://github.com/googleapis/java-spanner-jdbc/commit/75823638436e446f1e0a7904dd485b2f84b16f3d))
22+
* Update dependency io.opentelemetry:opentelemetry-bom to v1.56.0 ([#2278](https://github.com/googleapis/java-spanner-jdbc/issues/2278)) ([1fd49aa](https://github.com/googleapis/java-spanner-jdbc/commit/1fd49aa604a395032df675f5f9589eed9ea901c2))
23+
* Update dependency net.bytebuddy:byte-buddy to v1.18.1 ([#2279](https://github.com/googleapis/java-spanner-jdbc/issues/2279)) ([fa83919](https://github.com/googleapis/java-spanner-jdbc/commit/fa83919382619c3cb6abc567e7d6753a2e2ead33))
24+
* Update dependency net.bytebuddy:byte-buddy-agent to v1.18.1 ([#2280](https://github.com/googleapis/java-spanner-jdbc/issues/2280)) ([4237635](https://github.com/googleapis/java-spanner-jdbc/commit/4237635cc33784cecf9aa62d757fbf3fd4d1702d))
25+
* Update dependency org.apache.commons:commons-lang3 to v3.20.0 ([#2290](https://github.com/googleapis/java-spanner-jdbc/issues/2290)) ([eacbecb](https://github.com/googleapis/java-spanner-jdbc/commit/eacbecb7e5340d34d2de1208280dc9432144da26))
26+
* Update dependency org.testcontainers:testcontainers to v2.0.2 ([#2284](https://github.com/googleapis/java-spanner-jdbc/issues/2284)) ([092f5a1](https://github.com/googleapis/java-spanner-jdbc/commit/092f5a129761f0c8c9d8207c611232a086328896))
27+
* Update dependency org.testcontainers:testcontainers-bom to v2.0.2 ([#2285](https://github.com/googleapis/java-spanner-jdbc/issues/2285)) ([360a9fb](https://github.com/googleapis/java-spanner-jdbc/commit/360a9fbe0077abe072f2834823c9f208e2325fcf))
28+
329
## [2.33.3](https://github.com/googleapis/java-spanner-jdbc/compare/v2.33.2...v2.33.3) (2025-10-28)
430

531

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are using Maven, add this to your pom.xml file:
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>google-cloud-spanner-jdbc</artifactId>
23-
<version>2.33.3</version>
23+
<version>2.34.0</version>
2424
</dependency>
2525
```
2626
<!--- {x-version-update-end} -->
@@ -30,15 +30,15 @@ If you are using Gradle without BOM, add this to your dependencies
3030

3131
<!--- {x-version-update-start:google-cloud-spanner-jdbc:released} -->
3232
```Groovy
33-
implementation 'com.google.cloud:google-cloud-spanner-jdbc:2.33.3'
33+
implementation 'com.google.cloud:google-cloud-spanner-jdbc:2.34.0'
3434
```
3535
<!--- {x-version-update-end} -->
3636

3737
If you are using SBT, add this to your dependencies
3838

3939
<!--- {x-version-update-start:google-cloud-spanner-jdbc:released} -->
4040
```Scala
41-
libraryDependencies += "com.google.cloud" % "google-cloud-spanner-jdbc" % "2.33.3"
41+
libraryDependencies += "com.google.cloud" % "google-cloud-spanner-jdbc" % "2.34.0"
4242
```
4343
<!--- {x-version-update-end} -->
4444

documentation/connection_properties.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ The 'Context' value indicates whether the property can only be set when a connec
1313
| autocommit_dml_mode | Determines the transaction type that is used to execute DML statements when the connection is in auto-commit mode. | TRANSACTIONAL | TRANSACTIONAL, PARTITIONED_NON_ATOMIC, TRANSACTIONAL_WITH_FALLBACK_TO_PARTITIONED_NON_ATOMIC, null | USER |
1414
| autoconfigemulator | Automatically configure the connection to try to connect to the Cloud Spanner emulator (true/false). The instance and database in the connection string will automatically be created if these do not yet exist on the emulator. Add dialect=postgresql to the connection string to make sure that the database that is created uses the PostgreSQL dialect. | false | true, false | STARTUP |
1515
| autopartitionmode | Execute all queries on this connection as partitioned queries. Executing a query that cannot be partitioned will fail. Executing a query in a read/write transaction will also fail. | false | true, false | USER |
16+
| batch_dml_update_count | The update count that is returned for DML statements that are executed in an explicit DML batch. The default is -1 | -1 | | USER |
1617
| channelprovider | The name of the channel provider class. The name must reference an implementation of ExternalChannelProvider. If this property is not set, the connection will use the default grpc channel provider. | | | STARTUP |
1718
| clientcertificate | Specifies the file path to the client certificate required for establishing an mTLS connection. | | | STARTUP |
1819
| clientkey | Specifies the file path to the client private key required for establishing an mTLS connection. | | | STARTUP |
1920
| connection_state_type | The type of connection state to use for this connection. Can only be set at start up. If no value is set, then the database dialect default will be used, which is NON_TRANSACTIONAL for GoogleSQL and TRANSACTIONAL for PostgreSQL. | | TRANSACTIONAL, NON_TRANSACTIONAL | STARTUP |
20-
| credentials | The location of the credentials file to use for this connection. If neither this property or encoded credentials are set, the connection will use the default Google Cloud credentials for the runtime environment. | | | STARTUP |
21+
| credentials | The location of the credentials file to use for this connection. If neither this property or encoded credentials are set, the connection will use the default Google Cloud credentials for the runtime environment. WARNING: Using this property without proper validation can expose the application to security risks. It is intended for use with credentials from a trusted source only, as it could otherwise allow end-users to supply arbitrary credentials. For more information, seehttps://cloud.google.com/docs/authentication/client-libraries#external-credentials | | | STARTUP |
2122
| credentialsprovider | The class name of the com.google.api.gax.core.CredentialsProvider implementation that should be used to obtain credentials for connections. | | | STARTUP |
2223
| databaserole | Sets the database role to use for this connection. The default is privileges assigned to IAM role | | | STARTUP |
2324
| databoostenabled | Enable data boost for all partitioned queries that are executed by this connection. This setting is only used for partitioned queries and is ignored by all other statements. | false | true, false | USER |
@@ -31,8 +32,9 @@ The 'Context' value indicates whether the property can only be set when a connec
3132
| enabledirectaccess | Configure the connection to try to connect to Spanner using DirectPath (true/false). The client will try to connect to Spanner using a direct Google network connection. DirectPath will work only if the client is trying to establish a connection from a Google Cloud VM. Otherwise it will automatically fallback to the standard network path. NOTE: The default for this property is currently false, but this could be changed in the future. | | true, false | STARTUP |
3233
| enableendtoendtracing | Enable end-to-end tracing (true/false) to generate traces for both the time that is spent in the client, as well as time that is spent in the Spanner server. Server side traces can only go to Google Cloud Trace, so to see end to end traces, the application should configure an exporter that exports the traces to Google Cloud Trace. | false | true, false | STARTUP |
3334
| enableextendedtracing | Include the SQL string in the OpenTelemetry traces that are generated by this connection. The SQL string is added as the standard OpenTelemetry attribute 'db.statement'. | | true, false | STARTUP |
34-
| encodedcredentials | Base64-encoded credentials to use for this connection. If neither this property or a credentials location are set, the connection will use the default Google Cloud credentials for the runtime environment. | | | STARTUP |
35+
| encodedcredentials | Base64-encoded credentials to use for this connection. If neither this property or a credentials location are set, the connection will use the default Google Cloud credentials for the runtime environment. WARNING: Enabling this property without proper validation can expose the application to security risks. It is intended for use with credentials from a trusted source only, as it could otherwise allow end-users to supply arbitrary credentials. For more information, seehttps://cloud.google.com/docs/authentication/client-libraries#external-credentials | | | STARTUP |
3536
| endpoint | The endpoint that the JDBC driver should connect to. The default is the default Spanner production endpoint when autoConfigEmulator=false, and the default Spanner emulator endpoint (localhost:9010) when autoConfigEmulator=true. This property takes precedence over any host name at the start of the connection URL. | | | STARTUP |
37+
| grpc_interceptor_provider | The class name of a com.google.api.gax.grpc.GrpcInterceptorProvider implementation that should be used to provide interceptors for the underlying Spanner client. This is a guarded property that can only be set if the Java System Property ENABLE_GRPC_INTERCEPTOR_PROVIDER has been set to true. This property should only be set to true on systems where an untrusted user cannot modify the connection URL, as using this property will dynamically invoke the constructor of the class specified. This means that any user that can modify the connection URL, can also dynamically invoke code on the host where the application is running. | | | STARTUP |
3638
| isexperimentalhost | Set this value to true for communication with a Experimental Host. | false | true, false | STARTUP |
3739
| keeptransactionalive | Enabling this option will trigger the connection to keep read/write transactions alive by executing a SELECT 1 query once every 10 seconds if no other statements are being executed. This option should be used with caution, as it can keep transactions alive and hold on to locks longer than intended. This option should typically be used for CLI-type application that might wait for user input for a longer period of time. | false | true, false | USER |
3840
| lenient | Silently ignore unknown properties in the connection string/properties (true/false) | false | true, false | STARTUP |
@@ -53,11 +55,13 @@ The 'Context' value indicates whether the property can only be set when a connec
5355
| routetoleader | Should read/write transactions and partitioned DML be routed to leader region (true/false) | true | true, false | STARTUP |
5456
| rpcpriority | Sets the priority for all RPC invocations from this connection (HIGH/MEDIUM/LOW). The default is HIGH. | | LOW, MEDIUM, HIGH, UNSPECIFIED, null | USER |
5557
| savepoint_support | Determines the behavior of the connection when savepoints are used. | FAIL_AFTER_ROLLBACK | ENABLED, FAIL_AFTER_ROLLBACK, DISABLED | USER |
58+
| statement_timeout | Adds a timeout to all statements executed on this connection. This property is only used when a statement timeout is specified. | | | USER |
5659
| tracing_prefix | The prefix that will be prepended to all OpenTelemetry traces that are generated by a Connection. | CloudSpanner | | STARTUP |
5760
| trackconnectionleaks | Capture the call stack of the thread that created a connection. This will pre-create a LeakedConnectionException already when a connection is created. This can be disabled, for example if a monitoring system logs the pre-created exception. If disabled, the LeakedConnectionException will only be created when an actual connection leak is detected. The stack trace of the exception will in that case not contain the call stack of when the connection was created. | true | true, false | STARTUP |
5861
| tracksessionleaks | Capture the call stack of the thread that checked out a session of the session pool. This will pre-create a LeakedSessionException already when a session is checked out. This can be disabled, for example if a monitoring system logs the pre-created exception. If disabled, the LeakedSessionException will only be created when an actual session leak is detected. The stack trace of the exception will in that case not contain the call stack of when the session was checked out. | true | true, false | STARTUP |
5962
| transaction_timeout | Timeout for read/write transactions. | | | USER |
6063
| universedomain | Configure the connection to try to connect to Spanner using a different partner Google Universe than GDU (googleapis.com). | googleapis.com | | STARTUP |
64+
| unknownlength | Spanner does not return the length of the selected columns in query results. When returning meta-data about these columns through functions like ResultSetMetaData.getColumnDisplaySize and ResultSetMetaData.getPrecision, we must provide a value. Various client tools and applications have different ideas about what they would like to see. This property specifies the length to return for types of unknown length. | 50 | | USER |
6165
| useautosavepointsforemulator | Automatically creates savepoints for each statement in a read/write transaction when using the Emulator. This is no longer needed when using Emulator version 1.5.23 or higher. | false | true, false | STARTUP |
6266
| useplaintext | Use a plain text communication channel (i.e. non-TLS) for communicating with the server (true/false). Set this value to true for communication with the Cloud Spanner emulator. | false | true, false | STARTUP |
6367
| useragent | The custom user-agent property name to use when communicating with Cloud Spanner. This property is intended for internal library usage, and should not be set by applications. | | | STARTUP |

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<artifactId>google-cloud-spanner-jdbc</artifactId>
7-
<version>2.33.4-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner-jdbc:current} -->
7+
<version>2.34.0</version><!-- {x-version-update:google-cloud-spanner-jdbc:current} -->
88
<packaging>jar</packaging>
99
<name>Google Cloud Spanner JDBC</name>
1010
<url>https://github.com/googleapis/java-spanner-jdbc</url>
@@ -61,7 +61,7 @@
6161
<dependency>
6262
<groupId>com.google.cloud</groupId>
6363
<artifactId>google-cloud-spanner-bom</artifactId>
64-
<version>6.102.1</version>
64+
<version>6.103.0</version>
6565
<type>pom</type>
6666
<scope>import</scope>
6767
</dependency>
@@ -216,13 +216,13 @@
216216
<dependency>
217217
<groupId>com.google.cloud</groupId>
218218
<artifactId>google-cloud-trace</artifactId>
219-
<version>2.79.0</version>
219+
<version>2.80.0</version>
220220
<scope>test</scope>
221221
</dependency>
222222
<dependency>
223223
<groupId>com.google.api.grpc</groupId>
224224
<artifactId>proto-google-cloud-trace-v1</artifactId>
225-
<version>2.79.0</version>
225+
<version>2.80.0</version>
226226
<scope>test</scope>
227227
</dependency>
228228

samples/quickperf/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<dependency>
6363
<groupId>org.apache.commons</groupId>
6464
<artifactId>commons-lang3</artifactId>
65-
<version>3.19.0</version>
65+
<version>3.20.0</version>
6666
</dependency>
6767
<dependency>
6868
<groupId>com.fasterxml.jackson.core</groupId>

samples/snapshot/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<dependency>
3030
<groupId>com.google.cloud</groupId>
3131
<artifactId>google-cloud-spanner-jdbc</artifactId>
32-
<version>2.33.4-SNAPSHOT</version>
32+
<version>2.34.0</version>
3333
</dependency>
3434
<!-- {x-version-update-end} -->
3535

samples/spring-data-jdbc/googlesql/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>com.google.cloud</groupId>
3232
<artifactId>google-cloud-spanner-bom</artifactId>
33-
<version>6.102.1</version>
33+
<version>6.103.0</version>
3434
<scope>import</scope>
3535
<type>pom</type>
3636
</dependency>

samples/spring-data-jdbc/postgresql/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>com.google.cloud</groupId>
3232
<artifactId>google-cloud-spanner-bom</artifactId>
33-
<version>6.102.1</version>
33+
<version>6.103.0</version>
3434
<scope>import</scope>
3535
<type>pom</type>
3636
</dependency>

samples/spring-data-mybatis/googlesql/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<dependency>
3636
<groupId>com.google.cloud</groupId>
3737
<artifactId>google-cloud-spanner-bom</artifactId>
38-
<version>6.102.1</version>
38+
<version>6.103.0</version>
3939
<scope>import</scope>
4040
<type>pom</type>
4141
</dependency>
@@ -94,7 +94,7 @@
9494
<dependency>
9595
<groupId>com.google.cloud</groupId>
9696
<artifactId>google-cloud-spanner</artifactId>
97-
<version>6.102.1</version>
97+
<version>6.103.0</version>
9898
<type>test-jar</type>
9999
<scope>test</scope>
100100
</dependency>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import com.google.cloud.spanner.connection.AutocommitDmlMode;
3030
import com.google.cloud.spanner.connection.Connection;
3131
import com.google.cloud.spanner.connection.ConnectionOptions;
32+
import com.google.cloud.spanner.connection.ConnectionProperties;
3233
import com.google.cloud.spanner.connection.SavepointSupport;
3334
import com.google.cloud.spanner.connection.TransactionMode;
3435
import com.google.common.annotations.VisibleForTesting;
@@ -236,6 +237,11 @@ public String getOptimizerVersion() throws SQLException {
236237
return getSpannerConnection().getOptimizerVersion();
237238
}
238239

240+
/** Returns the value that should be returned for column types with an unknown length. */
241+
int getColumnTypeUnknownLength() {
242+
return getSpannerConnection().getConnectionPropertyValue(ConnectionProperties.UNKNOWN_LENGTH);
243+
}
244+
239245
@Override
240246
public boolean isInTransaction() throws SQLException {
241247
checkClosed();

0 commit comments

Comments
 (0)