Skip to content

Commit

Permalink
feat: support JSON data type (googleapis#447)
Browse files Browse the repository at this point in the history
* feat: support JSON data type

fix: NPE was thrown when getting an array of structs from a ResultSet (#445)

A NullPointerException was thrown if a ResultSet contained an array of Structs and
the getArray() method was called on the column.

Fixes #444

fix: cleanup and add documentation

chore(deps): update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.0.2 (#443)

chore: regenerate README (#450)

chore(deps): update dependency com.google.cloud:libraries-bom to v20.2.0 (#448)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `20.1.0` -> `20.2.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.2.0/compatibility-slim/20.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.2.0/confidence-slim/20.1.0)](https://docs.renovatebot.com/merge-confidence/) |

---

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

chore: add SECURITY.md (#446)

chore: add SECURITY.md

feat: allow get/set Spanner Value instances (#454)

Adds support for getting a value from a `java.sql.ResultSet` as a `com.google.cloud.spanner.Value` instance, and for setting a parameter on a `java.sql.PreparedStatement` using a `com.google.cloud.spanner.Value` instance.

Fixes #452

build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.1.2 (#451)

deps: update dependency com.google.cloud:google-cloud-spanner-bom to v6.4.0 (#453)

chore: remove unused statements file (#458)

The ClientSideStatements.json file has been moved to the Connection API
in the client library and is not needed in the JDBC driver.

chore: release 2.0.3-SNAPSHOT (#442)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

chore: adding cloud-rad java xrefs (#461)

Source-Author: Emily Ball <emilyball@google.com>
Source-Date: Thu May 6 11:48:47 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 046994f491c02806aea60118e214a9edd67f5ab7
Source-Link: https://github.com/googleapis/synthtool/commit/046994f491c02806aea60118e214a9edd67f5ab7

deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 (#463)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `1.0.0` -> `1.1.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.1.0/compatibility-slim/1.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.1.0/confidence-slim/1.0.0)](https://docs.renovatebot.com/merge-confidence/) |

---

<details>
<summary>googleapis/java-shared-dependencies</summary>

[Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v1.0.0...v1.1.0)

-   update dependency com.google.protobuf:protobuf-bom to v3.16.0 ([#&#8203;348](https://www.github.com/googleapis/java-shared-dependencies/issues/348)) ([0aacfde](https://www.github.com/googleapis/java-shared-dependencies/commit/0aacfdeec70e30803734db8287c47e4fad5481ef))
-   update gax.version to v1.64.0 ([#&#8203;345](https://www.github.com/googleapis/java-shared-dependencies/issues/345)) ([478bd35](https://www.github.com/googleapis/java-shared-dependencies/commit/478bd35296293e81c7e70157f50bfbebdc1bb54d))
-   update iam.version to v1.0.13 ([#&#8203;343](https://www.github.com/googleapis/java-shared-dependencies/issues/343)) ([3637923](https://www.github.com/googleapis/java-shared-dependencies/commit/363792392b71deff5cc5731104b631122fba5e61))

</details>

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

chore(deps): update dependency com.google.cloud:libraries-bom to v20.3.0 (#462)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `20.2.0` -> `20.3.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.3.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.3.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.3.0/compatibility-slim/20.2.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.3.0/confidence-slim/20.2.0)](https://docs.renovatebot.com/merge-confidence/) |

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

build(java): remove codecov action (#465)

This PR was generated using Autosynth. :rainbow:

Synth log will be available here:
https://source.cloud.google.com/results/invocations/8e8c0070-26ea-4d86-b07a-e4dcc9e5b8b1/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

Source-Link: https://github.com/googleapis/synthtool/commit/4f4b1b9b8d8b52f1e9e4a76165896debce5ab7f1

chore(deps): update dependency com.google.cloud:libraries-bom to v20.4.0 (#466)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `20.3.0` -> `20.4.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.4.0/compatibility-slim/20.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.4.0/confidence-slim/20.3.0)](https://docs.renovatebot.com/merge-confidence/) |

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

chore: add changelog to cloud-rad (#467)

This PR was generated using Autosynth. :rainbow:

Synth log will be available here:
https://source.cloud.google.com/results/invocations/41862329-45d0-4225-9ed2-ad5a75997ae8/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

Source-Link: https://github.com/googleapis/synthtool/commit/c86c7a60985644eab557949363a38301d40d78d2

tests: fixes jdbc query options test (#468)

* tests: fixes jdbc query options test

This test was failing, because we were no longer recreating the jdbc
connection from scratch. One of the tests, set an environment variable
specifying the optimizer version, which was permanently applied, since
the connection was not re-created.

Here we make sure to start / stop the static server before each test.

* chore: fixes linting errors

tests: fixes sql script test (#469)

In version 6.4.4 of spanner we have change the verifyStatementsInFile
method to wrap any SQLExceptions into SpannerExceptions.
In the failing tests we were catching SQLExceptions and ignoring them,
since they were expected.

We have changed the tests to also ignore the respective
SpannerExceptions.

deps: update dependency com.google.cloud:google-cloud-spanner-bom to v6.4.4 (#464)

chore: release 2.1.0 (#460)

:robot: I have created a release \*beep\* \*boop\*
---

* allow get/set Spanner Value instances ([#454](https://www.github.com/googleapis/java-spanner-jdbc/issues/454)) ([d6935b8](https://www.github.com/googleapis/java-spanner-jdbc/commit/d6935b863349c58cfdd44d6ce20dba6f5dbc1472)), closes [#452](https://www.github.com/googleapis/java-spanner-jdbc/issues/452)

* NPE was thrown when getting an array of structs from a ResultSet ([#445](https://www.github.com/googleapis/java-spanner-jdbc/issues/445)) ([1dfb37b](https://www.github.com/googleapis/java-spanner-jdbc/commit/1dfb37b27ee661718fe80be0bf260c40f4b15582)), closes [#444](https://www.github.com/googleapis/java-spanner-jdbc/issues/444)

* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#463](https://www.github.com/googleapis/java-spanner-jdbc/issues/463)) ([f148c71](https://www.github.com/googleapis/java-spanner-jdbc/commit/f148c71bef2b762d7b4475ba7f28443c7938c394))
* update dependency com.google.cloud:google-cloud-spanner-bom to v6.4.0 ([#453](https://www.github.com/googleapis/java-spanner-jdbc/issues/453)) ([7dac8b3](https://www.github.com/googleapis/java-spanner-jdbc/commit/7dac8b3e43625aa28be214bd735fc3386770de04))
* update dependency com.google.cloud:google-cloud-spanner-bom to v6.4.4 ([#464](https://www.github.com/googleapis/java-spanner-jdbc/issues/464)) ([eeb31c0](https://www.github.com/googleapis/java-spanner-jdbc/commit/eeb31c050fda116203d9da5c4a80c7f1c6a6cac4))
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

chore: release 2.1.1-SNAPSHOT (#470)

:robot: I have created a release \*beep\* \*boop\*
---
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

chore(deps): update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.1.0 (#471)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-spanner-jdbc](https://togithub.com/googleapis/java-spanner-jdbc) | `2.0.2` -> `2.1.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.1.0/compatibility-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.1.0/confidence-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) |

---

<details>
<summary>googleapis/java-spanner-jdbc</summary>

[Compare Source](https://togithub.com/googleapis/java-spanner-jdbc/compare/v2.0.2...v2.1.0)

-   allow get/set Spanner Value instances ([#&#8203;454](https://www.github.com/googleapis/java-spanner-jdbc/issues/454)) ([d6935b8](https://www.github.com/googleapis/java-spanner-jdbc/commit/d6935b863349c58cfdd44d6ce20dba6f5dbc1472)), closes [#&#8203;452](https://www.github.com/googleapis/java-spanner-jdbc/issues/452)

-   NPE was thrown when getting an array of structs from a ResultSet ([#&#8203;445](https://www.github.com/googleapis/java-spanner-jdbc/issues/445)) ([1dfb37b](https://www.github.com/googleapis/java-spanner-jdbc/commit/1dfb37b27ee661718fe80be0bf260c40f4b15582)), closes [#&#8203;444](https://www.github.com/googleapis/java-spanner-jdbc/issues/444)

-   update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#&#8203;463](https://www.github.com/googleapis/java-spanner-jdbc/issues/463)) ([f148c71](https://www.github.com/googleapis/java-spanner-jdbc/commit/f148c71bef2b762d7b4475ba7f28443c7938c394))
-   update dependency com.google.cloud:google-cloud-spanner-bom to v6.4.0 ([#&#8203;453](https://www.github.com/googleapis/java-spanner-jdbc/issues/453)) ([7dac8b3](https://www.github.com/googleapis/java-spanner-jdbc/commit/7dac8b3e43625aa28be214bd735fc3386770de04))
-   update dependency com.google.cloud:google-cloud-spanner-bom to v6.4.4 ([#&#8203;464](https://www.github.com/googleapis/java-spanner-jdbc/issues/464)) ([eeb31c0](https://www.github.com/googleapis/java-spanner-jdbc/commit/eeb31c050fda116203d9da5c4a80c7f1c6a6cac4))

-   release scripts from issuing overlapping phases ([#&#8203;434](https://www.github.com/googleapis/java-spanner-jdbc/issues/434)) ([b2eec0f](https://www.github.com/googleapis/java-spanner-jdbc/commit/b2eec0f079e64f5c21b89bbc0b02e3e981d6469a))
-   typo ([#&#8203;431](https://www.github.com/googleapis/java-spanner-jdbc/issues/431)) ([a0b158b](https://www.github.com/googleapis/java-spanner-jdbc/commit/a0b158bf9931d610779dec51ca61107078e9398e))

-   update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.1 ([#&#8203;438](https://www.github.com/googleapis/java-spanner-jdbc/issues/438)) ([aa56b5c](https://www.github.com/googleapis/java-spanner-jdbc/commit/aa56b5c1d5e3b1ccdaa0d5b877deccbda5aa0061))
-   update dependency com.google.cloud:google-cloud-shared-dependencies to v1 ([#&#8203;441](https://www.github.com/googleapis/java-spanner-jdbc/issues/441)) ([df7f0e7](https://www.github.com/googleapis/java-spanner-jdbc/commit/df7f0e796c03f9607e57b4b6ba999c92ea14c58d))
-   update dependency com.google.cloud:google-cloud-spanner-bom to v6.2.1 ([#&#8203;430](https://www.github.com/googleapis/java-spanner-jdbc/issues/430)) ([212d9d0](https://www.github.com/googleapis/java-spanner-jdbc/commit/212d9d05c4f28ade71ab5484792188b11a5bcd8b))
-   update dependency com.google.cloud:google-cloud-spanner-bom to v6.3.3 ([#&#8203;439](https://www.github.com/googleapis/java-spanner-jdbc/issues/439)) ([a128c4c](https://www.github.com/googleapis/java-spanner-jdbc/commit/a128c4cbe0e6b66f9276b71f7733a46645186e88))

-   update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.0 ([#&#8203;423](https://www.github.com/googleapis/java-spanner-jdbc/issues/423)) ([e0cf14a](https://www.github.com/googleapis/java-spanner-jdbc/commit/e0cf14a4dd087532924f49bb8e0431e1d681c7e8))
-   update dependency com.google.cloud:google-cloud-spanner-bom to v6.2.0 ([#&#8203;420](https://www.github.com/googleapis/java-spanner-jdbc/issues/420)) ([fdd8809](https://www.github.com/googleapis/java-spanner-jdbc/commit/fdd880943394e4760c26eadc3a87d5a298591eb1))

</details>

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

feat: add `gcf-owl-bot[bot]` to `ignoreAuthors` (#474)

This PR was generated using Autosynth. :rainbow:

Synth log will be available here:
https://source.cloud.google.com/results/invocations/35db7954-f063-42f8-9ff3-5d189e94e5d3/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

Source-Link: https://github.com/googleapis/synthtool/commit/7332178a11ddddc91188dc0f25bca1ccadcaa6c6

deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v1.2.0 (#473)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `1.1.0` -> `1.2.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.2.0/compatibility-slim/1.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.2.0/confidence-slim/1.1.0)](https://docs.renovatebot.com/merge-confidence/) |

---

<details>
<summary>googleapis/java-shared-dependencies</summary>

[Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v1.1.0...v1.2.0)

-   update dependency com.google.api-client:google-api-client-bom to v1.31.5 ([#&#8203;353](https://www.github.com/googleapis/java-shared-dependencies/issues/353)) ([8d72ab0](https://www.github.com/googleapis/java-shared-dependencies/commit/8d72ab003e08c864aedc17fc190ba26f393bf0c7))
-   update dependency com.google.errorprone:error_prone_annotations to v2.7.1 ([#&#8203;360](https://www.github.com/googleapis/java-shared-dependencies/issues/360)) ([8f952d0](https://www.github.com/googleapis/java-shared-dependencies/commit/8f952d05745358fc426a1a2dcb688da5d5010239))
-   update dependency com.google.protobuf:protobuf-bom to v3.17.0 ([#&#8203;355](https://www.github.com/googleapis/java-shared-dependencies/issues/355)) ([09858fb](https://www.github.com/googleapis/java-shared-dependencies/commit/09858fb4f1b78a77e828501597d20df4db0ebfcf))
-   update dependency io.grpc:grpc-bom to v1.37.1 ([#&#8203;359](https://www.github.com/googleapis/java-shared-dependencies/issues/359)) ([bc9869e](https://www.github.com/googleapis/java-shared-dependencies/commit/bc9869e914314f951afd69f2acae95c414398f43))
-   update google.common-protos.version to v2.2.1 ([#&#8203;358](https://www.github.com/googleapis/java-shared-dependencies/issues/358)) ([a3ed764](https://www.github.com/googleapis/java-shared-dependencies/commit/a3ed764a0e5143ee323d4b69c9747b8265d349e2))
-   update iam.version to v1.0.14 ([#&#8203;352](https://www.github.com/googleapis/java-shared-dependencies/issues/352)) ([bea9a01](https://www.github.com/googleapis/java-shared-dependencies/commit/bea9a01788ac1332a4bc7e06574ef5701700fe90))

</details>

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

chore: regenerate README (#472)

This PR was generated using Autosynth. :rainbow:

<details><summary>Log from Synthtool</summary>

```
2021-05-18 19:34:16,960 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-spanner-jdbc/.github/readme/synth.py.
On branch autosynth-readme
nothing to commit, working tree clean
2021-05-18 19:34:18,292 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata.

```
</details>

Full log will be available here:
https://source.cloud.google.com/results/invocations/572b047a-da68-49ed-98fa-b98e7f88514a/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

build(deps): update dependency com.google.cloud:google-cloud-shared-config to v0.12.0 (#476)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `0.11.2` -> `0.12.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.12.0/compatibility-slim/0.11.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.12.0/confidence-slim/0.11.2)](https://docs.renovatebot.com/merge-confidence/) |

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

chore: dump maven version along with java (#477)

This PR was generated using Autosynth. :rainbow:

Synth log will be available here:
https://source.cloud.google.com/results/invocations/9ea9dfcf-fef7-472c-9ebc-755e62e086c4/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

Source-Link: https://github.com/googleapis/synthtool/commit/8eae0234a16b26c2ff616d305dbd9786c8b10a47

docs: document connection properties in README (#478)

Adds documentation for the supported connection properties to the README file.

Fixes #456

chore: regenerate README (#481)

This PR was generated using Autosynth. :rainbow:

<details><summary>Log from Synthtool</summary>

```
2021-05-24 05:37:24,863 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-spanner-jdbc/.github/readme/synth.py.
On branch autosynth-readme
nothing to commit, working tree clean
2021-05-24 05:37:26,075 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata.

```
</details>

Full log will be available here:
https://source.cloud.google.com/results/invocations/5da15a47-718f-4374-b505-dead2c234c76/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

build(deps): update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.3.0 (#480)

chore(deps): update dependency com.google.cloud:libraries-bom to v20.5.0 (#482)

deps: update dependency com.google.cloud:google-cloud-spanner-bom to v6.5.0 (#483)

test(deps): update dependency com.google.truth:truth to v1.1.3 (#484)

test(deps): update dependency com.google.truth:truth to v1.1.3 (#485)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| com.google.truth:truth | `1.1.2` -> `1.1.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.truth:truth/1.1.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.truth:truth/1.1.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.truth:truth/1.1.3/compatibility-slim/1.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.truth:truth/1.1.3/confidence-slim/1.1.2)](https://docs.renovatebot.com/merge-confidence/) |

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

chore: release 2.2.0 (#475)

:robot: I have created a release \*beep\* \*boop\*
---

* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#474](https://www.github.com/googleapis/java-spanner-jdbc/issues/474)) ([c14f17b](https://www.github.com/googleapis/java-spanner-jdbc/commit/c14f17b411b15e778a68ce998de04732b159d7ac))

* document connection properties in README ([#478](https://www.github.com/googleapis/java-spanner-jdbc/issues/478)) ([3ccc543](https://www.github.com/googleapis/java-spanner-jdbc/commit/3ccc5433bec261b18d2536b04590e7645e47ed9b)), closes [#456](https://www.github.com/googleapis/java-spanner-jdbc/issues/456)

* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.2.0 ([#473](https://www.github.com/googleapis/java-spanner-jdbc/issues/473)) ([a6cc069](https://www.github.com/googleapis/java-spanner-jdbc/commit/a6cc0697ed5916c665f007a1bf16660b8b91f9f9))
* update dependency com.google.cloud:google-cloud-spanner-bom to v6.5.0 ([#483](https://www.github.com/googleapis/java-spanner-jdbc/issues/483)) ([e7fec30](https://www.github.com/googleapis/java-spanner-jdbc/commit/e7fec30f2f2c5518821d5348d448f102301d65c3))
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

chore: release 2.2.1-SNAPSHOT (#487)

:robot: I have created a release \*beep\* \*boop\*
---
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

chore(deps): update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.2.0 (#488)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-spanner-jdbc](https://togithub.com/googleapis/java-spanner-jdbc) | `2.1.0` -> `2.2.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.2.0/compatibility-slim/2.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.2.0/confidence-slim/2.1.0)](https://docs.renovatebot.com/merge-confidence/) |

---

<details>
<summary>googleapis/java-spanner-jdbc</summary>

[Compare Source](https://togithub.com/googleapis/java-spanner-jdbc/compare/v2.1.0...v2.2.0)

-   add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#&#8203;474](https://www.github.com/googleapis/java-spanner-jdbc/issues/474)) ([c14f17b](https://www.github.com/googleapis/java-spanner-jdbc/commit/c14f17b411b15e778a68ce998de04732b159d7ac))

-   document connection properties in README ([#&#8203;478](https://www.github.com/googleapis/java-spanner-jdbc/issues/478)) ([3ccc543](https://www.github.com/googleapis/java-spanner-jdbc/commit/3ccc5433bec261b18d2536b04590e7645e47ed9b)), closes [#&#8203;456](https://www.github.com/googleapis/java-spanner-jdbc/issues/456)

-   update dependency com.google.cloud:google-cloud-shared-dependencies to v1.2.0 ([#&#8203;473](https://www.github.com/googleapis/java-spanner-jdbc/issues/473)) ([a6cc069](https://www.github.com/googleapis/java-spanner-jdbc/commit/a6cc0697ed5916c665f007a1bf16660b8b91f9f9))
-   update dependency com.google.cloud:google-cloud-spanner-bom to v6.5.0 ([#&#8203;483](https://www.github.com/googleapis/java-spanner-jdbc/issues/483)) ([e7fec30](https://www.github.com/googleapis/java-spanner-jdbc/commit/e7fec30f2f2c5518821d5348d448f102301d65c3))

</details>

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

chore: regenerate README (#489)

This PR was generated using Autosynth. :rainbow:

<details><summary>Log from Synthtool</summary>

```
2021-06-02 20:28:22,584 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-spanner-jdbc/.github/readme/synth.py.
On branch autosynth-readme
nothing to commit, working tree clean
2021-06-02 20:28:23,968 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata.

```
</details>

Full log will be available here:
https://source.cloud.google.com/results/invocations/f9c652de-b905-42d2-8dff-d97f0e0d5476/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v1.3.0 (#490)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `1.2.0` -> `1.3.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.3.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.3.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.3.0/compatibility-slim/1.2.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.3.0/confidence-slim/1.2.0)](https://docs.renovatebot.com/merge-confidence/) |

---

<details>
<summary>googleapis/java-shared-dependencies</summary>

[Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v1.2.0...v1.3.0)

-   add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#&#8203;365](https://www.github.com/googleapis/java-shared-dependencies/issues/365)) ([7e8309b](https://www.github.com/googleapis/java-shared-dependencies/commit/7e8309bf67ade0fe2b09f792848136cd88b4d2e4))

-   update dependency com.google.auth:google-auth-library-bom to v0.26.0 ([#&#8203;368](https://www.github.com/googleapis/java-shared-dependencies/issues/368)) ([38256a8](https://www.github.com/googleapis/java-shared-dependencies/commit/38256a82cb6896c3f5e5ea6ca5d8d671c412bf84))
-   update dependency com.google.cloud:google-cloud-core-bom to v1.95.0 ([#&#8203;377](https://www.github.com/googleapis/java-shared-dependencies/issues/377)) ([297ea62](https://www.github.com/googleapis/java-shared-dependencies/commit/297ea621e02f8c0679c8b07ed399d11eaacecc14))
-   update dependency com.google.code.gson:gson to v2.8.7 ([#&#8203;370](https://www.github.com/googleapis/java-shared-dependencies/issues/370)) ([cdc1b8e](https://www.github.com/googleapis/java-shared-dependencies/commit/cdc1b8ea1c93f97b712081ca8dc8ea57f342b69e))
-   update dependency com.google.protobuf:protobuf-bom to v3.17.1 ([#&#8203;369](https://www.github.com/googleapis/java-shared-dependencies/issues/369)) ([5a19574](https://www.github.com/googleapis/java-shared-dependencies/commit/5a19574bc626bb3c6b573ed1d177e8907188dec1))
-   update dependency com.google.protobuf:protobuf-bom to v3.17.2 ([#&#8203;374](https://www.github.com/googleapis/java-shared-dependencies/issues/374)) ([83516e6](https://www.github.com/googleapis/java-shared-dependencies/commit/83516e691b99e5e5d22d27e561781a5ade5fb514))
-   update dependency io.grpc:grpc-bom to v1.38.0 ([#&#8203;364](https://www.github.com/googleapis/java-shared-dependencies/issues/364)) ([00db570](https://www.github.com/googleapis/java-shared-dependencies/commit/00db5701c3b0aa609f3778c06911a9a0248ca342))
-   update gax.version to v1.65.0 ([#&#8203;376](https://www.github.com/googleapis/java-shared-dependencies/issues/376)) ([b793a0d](https://www.github.com/googleapis/java-shared-dependencies/commit/b793a0d7744ff1b0f8ae5d3d13ec4776ae8d3089))
-   update google.common-protos.version to v2.3.1 ([#&#8203;366](https://www.github.com/googleapis/java-shared-dependencies/issues/366)) ([7d6a7fa](https://www.github.com/googleapis/java-shared-dependencies/commit/7d6a7fa7a2cad2b3f2ecf45e42d2ed5db0b60a43))
-   update google.common-protos.version to v2.3.2 ([#&#8203;375](https://www.github.com/googleapis/java-shared-dependencies/issues/375)) ([68a47ad](https://www.github.com/googleapis/java-shared-dependencies/commit/68a47ad3243f3e980db74c9c8505a1b3063c131b))

</details>

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

chore: release 2.2.1 (#491)

:robot: I have created a release \*beep\* \*boop\*
---

* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.3.0 ([#490](https://www.github.com/googleapis/java-spanner-jdbc/issues/490)) ([bf0c9d6](https://www.github.com/googleapis/java-spanner-jdbc/commit/bf0c9d6bf612b50a59ea2d530430ccace79aaf35))
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

chore: release 2.2.2-SNAPSHOT (#492)

:robot: I have created a release \*beep\* \*boop\*
---
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

chore(deps): update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.2.1 (#493)

chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.23 (#494)

chore: regenerate README (#495)

This PR was generated using Autosynth. :rainbow:

<details><summary>Log from Synthtool</summary>

```
2021-06-05 09:53:24,030 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-spanner-jdbc/.github/readme/synth.py.
On branch autosynth-readme
nothing to commit, working tree clean
2021-06-05 09:53:25,229 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata.

```
</details>

Full log will be available here:
https://source.cloud.google.com/results/invocations/2c57a5bd-142d-430b-9931-a1a1a7e59a30/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

chore(deps): update dependency com.google.cloud:libraries-bom to v20.6.0 (#496)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `20.5.0` -> `20.6.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.6.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.6.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.6.0/compatibility-slim/20.5.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.6.0/confidence-slim/20.5.0)](https://docs.renovatebot.com/merge-confidence/) |

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

deps: update dependency com.google.cloud:google-cloud-spanner-bom to v6.6.0 (#498)

* deps: update dependency com.google.cloud:google-cloud-spanner-bom to v6.6.0

Updates to Spanner client 6.6.0 and adds tests for optimizer stats package.

Replaces #497

* test: implement missing method for integration test

chore: release 2.2.2 (#499)

:robot: I have created a release \*beep\* \*boop\*
---

* update dependency com.google.cloud:google-cloud-spanner-bom to v6.6.0 ([#498](https://www.github.com/googleapis/java-spanner-jdbc/issues/498)) ([5849a97](https://www.github.com/googleapis/java-spanner-jdbc/commit/5849a970087d3fa1d1b42092b4568602563a1dbd))
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

chore: release 2.2.3-SNAPSHOT (#500)

:robot: I have created a release \*beep\* \*boop\*
---
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

deps: update dependency com.google.cloud:google-cloud-spanner-bom to v6.6.1 (#502)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-spanner-bom](https://togithub.com/googleapis/java-spanner) | `6.6.0` -> `6.6.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-bom/6.6.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-bom/6.6.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-bom/6.6.1/compatibility-slim/6.6.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-bom/6.6.1/confidence-slim/6.6.0)](https://docs.renovatebot.com/merge-confidence/) |

---

<details>
<summary>googleapis/java-spanner</summary>

[Compare Source](https://togithub.com/googleapis/java-spanner/compare/v6.6.0...v6.6.1)

</details>

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

chore: release 2.2.3 (#504)

:robot: I have created a release \*beep\* \*boop\*
---

* update dependency com.google.cloud:google-cloud-spanner-bom to v6.6.1 ([#502](https://www.github.com/googleapis/java-spanner-jdbc/issues/502)) ([41a9cd4](https://www.github.com/googleapis/java-spanner-jdbc/commit/41a9cd49fed468f410ad226555f7b9ba46d857b3))
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

chore: regenerate README (#505)

This PR was generated using Autosynth. :rainbow:

<details><summary>Log from Synthtool</summary>

```
2021-06-15 21:17:11,110 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-spanner-jdbc/.github/readme/synth.py.
On branch autosynth-readme
nothing to commit, working tree clean
2021-06-15 21:17:12,273 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata.

```
</details>

Full log will be available here:
https://source.cloud.google.com/results/invocations/0bc6fb82-3b4e-44b2-978c-65fa57b88268/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

chore: release 2.2.4-SNAPSHOT (#507)

:robot: I have created a release \*beep\* \*boop\*
---
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

fix: Update dependencies.sh to not break on mac (#506)

This PR was generated using Autosynth. :rainbow:

Synth log will be available here:
https://source.cloud.google.com/results/invocations/f853e0b6-9a6b-4346-9a07-ff7c7ec6f858/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

Source-Link: https://github.com/googleapis/synthtool/commit/8f76a885deaaf2fe234daeba4a8cc4d1b3de8086

chore(deps): update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.2.2 (#501)

chore: regenerate README (#510)

This PR was generated using Autosynth. :rainbow:

<details><summary>Log from Synthtool</summary>

```
2021-06-15 23:11:37,759 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-spanner-jdbc/.github/readme/synth.py.
On branch autosynth-readme
nothing to commit, working tree clean
2021-06-15 23:11:38,999 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata.

```
</details>

Full log will be available here:
https://source.cloud.google.com/results/invocations/61cfb5e0-68cd-47b3-89b4-af4a25c2c4b6/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

fix: prevent relocating urls that start with com like /computeMetadata/ (#511)

Fixes #503

In addition to original problem I have added an exception for all the Netty libraries since I have got errors on service provider which claims that netty libraries are not a subtype.

chore(deps): update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.2.3 (#509)

chore: minimize noise from build scripts (#512)

This PR was generated using Autosynth. :rainbow:

Synth log will be available here:
https://source.cloud.google.com/results/invocations/88f2626c-4d2d-42a7-9d16-aaa685eaa74a/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

Source-Link: https://github.com/googleapis/synthtool/commit/1c0c698705e668ccb3d68556ae7260f16ce63a6e

fix: Add `shopt -s nullglob` to dependencies script (#514)

This PR was generated using Autosynth. :rainbow:

Synth log will be available here:
https://source.cloud.google.com/results/invocations/bc91c2d7-c025-42b9-ab03-f02a01c15622/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

Source-Link: https://github.com/googleapis/synthtool/commit/87254ac89a9559864c0a245d6b150406439ce3d8

chore(deps): update dependency com.google.cloud:libraries-bom to v20.7.0 (#515)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `20.6.0` -> `20.7.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.7.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.7.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.7.0/compatibility-slim/20.6.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.7.0/confidence-slim/20.6.0)](https://docs.renovatebot.com/merge-confidence/) |

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

deps: update dependency com.google.cloud:google-cloud-spanner-bom to v6.7.0 (#513)

deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 (#518)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `1.3.0` -> `1.4.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.4.0/compatibility-slim/1.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.4.0/confidence-slim/1.3.0)](https://docs.renovatebot.com/merge-confidence/) |

---

<details>
<summary>googleapis/java-shared-dependencies</summary>

[Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v1.3.0...v1.4.0)

-   add grpc-gcp to dependencyManagement ([#&#8203;389](https://www.github.com/googleapis/java-shared-dependencies/issues/389)) ([57fd2e6](https://www.github.com/googleapis/java-shared-dependencies/commit/57fd2e646e28e37e0b5e4e1b37425d4897a8776f))

-   Add `shopt -s nullglob` to dependencies script ([#&#8203;392](https://www.github.com/googleapis/java-shared-dependencies/issues/392)) ([f8f29df](https://www.github.com/googleapis/java-shared-dependencies/commit/f8f29df1c9cc6eca517c99113fb9509fd611ac92))
-   Add common httpclient and oauth dependencies ([#&#8203;391](https://www.github.com/googleapis/java-shared-dependencies/issues/391)) ([09660e1](https://www.github.com/googleapis/java-shared-dependencies/commit/09660e1e50c96dcd7df4e80d8ad357f8256eda6c))
-   Update dependencies.sh to not break on mac ([#&#8203;384](https://www.github.com/googleapis/java-shared-dependencies/issues/384)) ([0ae2841](https://www.github.com/googleapis/java-shared-dependencies/commit/0ae2841d7ce2885d041795c58a38d2d3973c2e5a))

-   update dependency com.google.api-client:google-api-client-bom to v1.32.1 ([#&#8203;390](https://www.github.com/googleapis/java-shared-dependencies/issues/390)) ([00288c1](https://www.github.com/googleapis/java-shared-dependencies/commit/00288c18d09616582c8bec961ecc5c00ef1d4288))
-   update dependency com.google.api:api-common to v1.10.4 ([#&#8203;385](https://www.github.com/googleapis/java-shared-dependencies/issues/385)) ([5f2b39b](https://www.github.com/googleapis/java-shared-dependencies/commit/5f2b39b5bdc4cec9d5ab2f050e11000ed372d057))
-   update dependency com.google.api:gax-grpc to v1.65.1 ([#&#8203;382](https://www.github.com/googleapis/java-shared-dependencies/issues/382)) ([a2a1547](https://www.github.com/googleapis/java-shared-dependencies/commit/a2a15471dee21207a0b97b3bc8f6f59d6a4a2d13))
-   update dependency com.google.protobuf:protobuf-bom to v3.17.3 ([#&#8203;379](https://www.github.com/googleapis/java-shared-dependencies/issues/379)) ([6f43eb5](https://www.github.com/googleapis/java-shared-dependencies/commit/6f43eb553dca98140d343bee3f1003096d79ee6c))
-   update dependency io.grpc:grpc-bom to v1.38.1 ([#&#8203;386](https://www.github.com/googleapis/java-shared-dependencies/issues/386)) ([7b1d4cf](https://www.github.com/googleapis/java-shared-dependencies/commit/7b1d4cf317fbd75b91d6a63f82b5fc2f46eaf3ca))
-   update dependency io.grpc:grpc-bom to v1.39.0 ([#&#8203;394](https://www.github.com/googleapis/java-shared-dependencies/issues/394)) ([ebc8af6](https://www.github.com/googleapis/java-shared-dependencies/commit/ebc8af6b3f850b58b35d9720a7a0b1545d4616bd))
-   update gax.version to v1.66.0 ([#&#8203;395](https://www.github.com/googleapis/java-shared-dependencies/issues/395)) ([c73f73e](https://www.github.com/googleapis/java-shared-dependencies/commit/c73f73e84740a8117be342a66e179eaf3e29c6fd))
-   update google.core.version to v1.95.1 ([#&#8203;381](https://www.github.com/googleapis/java-shared-dependencies/issues/381)) ([4496153](https://www.github.com/googleapis/java-shared-dependencies/commit/44961532f621b0ab19e9e7feebb7d588aef5d423))
-   update google.core.version to v1.95.2 ([#&#8203;383](https://www.github.com/googleapis/java-shared-dependencies/issues/383)) ([7216859](https://www.github.com/googleapis/java-shared-dependencies/commit/7216859bcd67fa1ce1119831c33c50a2d5b79324))
-   update google.core.version to v1.95.3 ([#&#8203;388](https://www.github.com/googleapis/java-shared-dependencies/issues/388)) ([354e4e8](https://www.github.com/googleapis/java-shared-dependencies/commit/354e4e811f4ba886406681a4261ac0455a9eb2d2))
-   update google.core.version to v1.95.4 ([#&#8203;393](https://www.github.com/googleapis/java-shared-dependencies/issues/393)) ([be78ad8](https://www.github.com/googleapis/java-shared-dependencies/commit/be78ad85e31d8876eabafee7aa8242712573cb46))

</details>

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

deps: update dependency com.google.cloud:google-cloud-spanner-bom to v6.8.0 (#517)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-spanner-bom](https://togithub.com/googleapis/java-spanner) | `6.7.0` -> `6.8.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-bom/6.8.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-bom/6.8.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-bom/6.8.0/compatibility-slim/6.7.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-bom/6.8.0/confidence-slim/6.7.0)](https://docs.renovatebot.com/merge-confidence/) |

---

<details>
<summary>googleapis/java-spanner</summary>

[Compare Source](https://togithub.com/googleapis/java-spanner/compare/v6.7.0...v6.8.0)

-   add gRPC-GCP channel pool as an option ([#&#8203;1227](https://www.github.com/googleapis/java-spanner/issues/1227)) ([1fa95a9](https://www.github.com/googleapis/java-spanner/commit/1fa95a9993ea8c7a5f943ab39eced4ced4cb87e7))
-   spanner JSON type ([#&#8203;1260](https://www.github.com/googleapis/java-spanner/issues/1260)) ([b2a56c6](https://www.github.com/googleapis/java-spanner/commit/b2a56c68695b6209e20f9f86d83d7c5a0f39c7a8))

-   Add `shopt -s nullglob` to dependencies script ([#&#8203;1256](https://www.github.com/googleapis/java-spanner/issues/1256)) ([d1712f7](https://www.github.com/googleapis/java-spanner/commit/d1712f7c51752c2359045e5eabac8fc0530a2421))

</details>

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

chore: release 2.2.4 (#508)

:robot: I have created a release \*beep\* \*boop\*
---

* Add `shopt -s nullglob` to dependencies script ([#514](https://www.github.com/googleapis/java-spanner-jdbc/issues/514)) ([ae51b24](https://www.github.com/googleapis/java-spanner-jdbc/commit/ae51b241148606ffddeb0a703b853de67710e48b))
* prevent relocating urls that start with com like /computeMetadata/ ([#511](https://www.github.com/googleapis/java-spanner-jdbc/issues/511)) ([1178a1d](https://www.github.com/googleapis/java-spanner-jdbc/commit/1178a1d35b4b0032acf71b3dbf862d4f9fb9399c))
* Update dependencies.sh to not break on mac ([#506](https://www.github.com/googleapis/java-spanner-jdbc/issues/506)) ([e205c0c](https://www.github.com/googleapis/java-spanner-jdbc/commit/e205c0c8eba6ac23d747c433b42d8e2365528bd8))

* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#518](https://www.github.com/googleapis/java-spanner-jdbc/issues/518)) ([045b858](https://www.github.com/googleapis/java-spanner-jdbc/commit/045b8586a7ca7b0e2bd341b27ca3e8a3530c992a))
* update dependency com.google.cloud:google-cloud-spanner-bom to v6.7.0 ([#513](https://www.github.com/googleapis/java-spanner-jdbc/issues/513)) ([e1affe3](https://www.github.com/googleapis/java-spanner-jdbc/commit/e1affe358a812a45b9d2c0c9ccd0b00e3aa3791e))
* update dependency com.google.cloud:google-cloud-spanner-bom to v6.8.0 ([#517](https://www.github.com/googleapis/java-spanner-jdbc/issues/517)) ([c9013ff](https://www.github.com/googleapis/java-spanner-jdbc/commit/c9013ff48269b158121e4c65c545be30752c31fb))
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

chore: release 2.2.5-SNAPSHOT (#519)

:robot: I have created a release \*beep\* \*boop\*
---
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

deps: update dependency com.google.cloud:google-cloud-spanner-bom to v6.9.0 (#521)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-spanner-bom](https://togithub.com/googleapis/java-spanner) | `6.8.0` -> `6.9.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-bom/6.9.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-bom/6.9.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-bom/6.9.0/compatibility-slim/6.8.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-bom/6.9.0/confidence-slim/6.8.0)](https://docs.renovatebot.com/merge-confidence/) |

---

<details>
<summary>googleapis/java-spanner</summary>

[Compare Source](https://togithub.com/googleapis/java-spanner/compare/v6.8.0...v6.9.0)

-   add support for tagging to Connection API ([#&#8203;623](https://www.github.com/googleapis/java-spanner/issues/623)) ([5722372](https://www.github.com/googleapis/java-spanner/commit/5722372b7869828e372dec06e80e5b0e7280af61))
-   **spanner:** add leader_options to InstanceConfig and default_leader to Database ([#&#8203;1271](https://www.github.com/googleapis/java-spanner/issues/1271)) ([f257671](https://www.github.com/googleapis/java-spanner/commit/f25767144344f0df67662f1b3ef662902384599a))
-   support setting an async executor provider ([#&#8203;1263](https://www.github.com/googleapis/java-spanner/issues/1263)) ([369c8a7](https://www.github.com/googleapis/java-spanner/commit/369c8a771ec48fa1476236f800b0e8eb5982a33c))

-   update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#&#8203;1269](https://www.github.com/googleapis/java-spanner/issues/1269)) ([025e162](https://www.github.com/googleapis/java-spanner/commit/025e162813d6321dabe49e32f00934f9ae334e24))

</details>

---

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).

chore: release 2.2.5 (#522)

:robot: I have created a release \*beep\* \*boop\*
---

* update dependency com.google.cloud:google-cloud-spanner-bom to v6.9.0 ([#521](https://www.github.com/googleapis/java-spanner-jdbc/issues/521)) ([8d840ac](https://www.github.com/googleapis/java-spanner-jdbc/commit/8d840ac855f4466c1d53a3b38d964e213708e5e5))
---

This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).

chore: regenerate README (#523)

This PR was generated using Autosynth. :rainbow:

<details><summary>Log from Synthtool</summary>

```
2021-07-06 00:20:39,365 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-spanner-jdbc/.github/readme/synth.py.
On branch autosynth-readme
nothing to commit, working tree clean
2021-07-06 00:20:40,571 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata.

```
</d…
  • Loading branch information
olavloite committed Aug 25, 2021
1 parent 882f8c2 commit ca1c906
Show file tree
Hide file tree
Showing 18 changed files with 578 additions and 126 deletions.
Expand Up @@ -48,6 +48,7 @@ static int extractColumnType(Type type) {
if (type.equals(Type.int64())) return Types.BIGINT;
if (type.equals(Type.numeric())) return Types.NUMERIC;
if (type.equals(Type.string())) return Types.NVARCHAR;
if (type.equals(Type.json())) return Types.NVARCHAR;
if (type.equals(Type.timestamp())) return Types.TIMESTAMP;
if (type.getCode() == Code.ARRAY) return Types.ARRAY;
return Types.OTHER;
Expand Down Expand Up @@ -106,6 +107,7 @@ static String getClassName(Type type) {
if (type == Type.int64()) return Long.class.getName();
if (type == Type.numeric()) return BigDecimal.class.getName();
if (type == Type.string()) return String.class.getName();
if (type == Type.json()) return String.class.getName();
if (type == Type.timestamp()) return Timestamp.class.getName();
if (type.getCode() == Code.ARRAY) {
if (type.getArrayElementType() == Type.bool()) return Boolean[].class.getName();
Expand All @@ -115,6 +117,7 @@ static String getClassName(Type type) {
if (type.getArrayElementType() == Type.int64()) return Long[].class.getName();
if (type.getArrayElementType() == Type.numeric()) return BigDecimal[].class.getName();
if (type.getArrayElementType() == Type.string()) return String[].class.getName();
if (type.getArrayElementType() == Type.json()) return String[].class.getName();
if (type.getArrayElementType() == Type.timestamp()) return Timestamp[].class.getName();
}
return null;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/google/cloud/spanner/jdbc/JdbcArray.java
Expand Up @@ -21,6 +21,7 @@
import com.google.cloud.spanner.Struct;
import com.google.cloud.spanner.Type;
import com.google.cloud.spanner.Type.StructField;
import com.google.cloud.spanner.Value;
import com.google.cloud.spanner.ValueBinder;
import com.google.common.collect.ImmutableList;
import com.google.rpc.Code;
Expand Down Expand Up @@ -201,6 +202,9 @@ public ResultSet getResultSet(long startIndex, int count) throws SQLException {
case STRING:
builder = binder.to((String) value);
break;
case JSON:
builder = binder.to(Value.json((String) value));
break;
case TIMESTAMP:
builder = binder.to(JdbcTypeConverter.toGoogleTimestamp((Timestamp) value));
break;
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/com/google/cloud/spanner/jdbc/JdbcDataType.java
Expand Up @@ -229,6 +229,32 @@ public Type getSpannerType() {
return Type.string();
}
},
JSON {
@Override
public int getSqlType() {
return JsonType.VENDOR_TYPE_NUMBER;
}

@Override
public Class<String> getJavaClass() {
return String.class;
}

@Override
public Code getCode() {
return Code.JSON;
}

@Override
public List<String> getArrayElements(ResultSet rs, int columnIndex) {
return rs.getJsonList(columnIndex);
}

@Override
public Type getSpannerType() {
return Type.json();
}
},
TIMESTAMP {
@Override
public int getSqlType() {
Expand Down
80 changes: 58 additions & 22 deletions src/main/java/com/google/cloud/spanner/jdbc/JdbcParameterStore.java
Expand Up @@ -19,6 +19,7 @@
import com.google.cloud.ByteArray;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.Statement.Builder;
import com.google.cloud.spanner.Type;
import com.google.cloud.spanner.Value;
import com.google.cloud.spanner.ValueBinder;
import com.google.cloud.spanner.jdbc.JdbcSqlExceptionFactory.JdbcSqlExceptionImpl;
Expand Down Expand Up @@ -264,6 +265,7 @@ private boolean isTypeSupported(int sqlType) {
case Types.NCLOB:
case Types.NUMERIC:
case Types.DECIMAL:
case JsonType.VENDOR_TYPE_NUMBER:
return true;
}
return false;
Expand Down Expand Up @@ -315,6 +317,11 @@ private boolean isValidTypeAndValue(Object value, int sqlType) {
return value instanceof Clob || value instanceof Reader;
case Types.NCLOB:
return value instanceof NClob || value instanceof Reader;
case JsonType.VENDOR_TYPE_NUMBER:
return value instanceof String
|| value instanceof InputStream
|| value instanceof Reader
|| (value instanceof Value && ((Value) value).getType().getCode() == Type.Code.JSON);
}
return false;
}
Expand Down Expand Up @@ -544,30 +551,34 @@ private Builder setParamWithKnownType(ValueBinder<Builder> binder, Object value,
case Types.NCHAR:
case Types.NVARCHAR:
case Types.LONGNVARCHAR:
String stringValue;
if (value instanceof String) {
return binder.to((String) value);
stringValue = (String) value;
} else if (value instanceof InputStream) {
InputStreamReader reader =
new InputStreamReader((InputStream) value, StandardCharsets.US_ASCII);
try {
return binder.to(CharStreams.toString(reader));
} catch (IOException e) {
throw JdbcSqlExceptionFactory.of(
"could not set string from input stream", Code.INVALID_ARGUMENT, e);
}
stringValue = getStringFromInputStream((InputStream) value);
} else if (value instanceof Reader) {
try {
return binder.to(CharStreams.toString((Reader) value));
} catch (IOException e) {
throw JdbcSqlExceptionFactory.of(
"could not set string from reader", Code.INVALID_ARGUMENT, e);
}
stringValue = getStringFromReader((Reader) value);
} else if (value instanceof URL) {
return binder.to(((URL) value).toString());
stringValue = ((URL) value).toString();
} else if (value instanceof UUID) {
return binder.to(((UUID) value).toString());
stringValue = ((UUID) value).toString();
} else {
throw JdbcSqlExceptionFactory.of(value + " is not a valid string", Code.INVALID_ARGUMENT);
}
return binder.to(stringValue);
case JsonType.VENDOR_TYPE_NUMBER:
String jsonValue;
if (value instanceof String) {
jsonValue = (String) value;
} else if (value instanceof InputStream) {
jsonValue = getStringFromInputStream((InputStream) value);
} else if (value instanceof Reader) {
jsonValue = getStringFromReader((Reader) value);
} else {
throw JdbcSqlExceptionFactory.of(
value + " is not a valid JSON value", Code.INVALID_ARGUMENT);
}
throw JdbcSqlExceptionFactory.of(value + " is not a valid string", Code.INVALID_ARGUMENT);
return binder.to(Value.json(jsonValue));
case Types.DATE:
if (value instanceof Date) {
return binder.to(JdbcTypeConverter.toGoogleDate((Date) value));
Expand Down Expand Up @@ -652,6 +663,25 @@ private Builder setParamWithKnownType(ValueBinder<Builder> binder, Object value,
return null;
}

private String getStringFromInputStream(InputStream inputStream) throws SQLException {
InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.US_ASCII);
try {
return CharStreams.toString(reader);
} catch (IOException e) {
throw JdbcSqlExceptionFactory.of(
"could not set string from input stream", Code.INVALID_ARGUMENT, e);
}
}

private String getStringFromReader(Reader reader) throws SQLException {
try {
return CharStreams.toString(reader);
} catch (IOException e) {
throw JdbcSqlExceptionFactory.of(
"could not set string from reader", Code.INVALID_ARGUMENT, e);
}
}

/** Set the parameter value based purely on the type of the value. */
private Builder setParamWithUnknownType(ValueBinder<Builder> binder, Object value)
throws SQLException {
Expand Down Expand Up @@ -769,14 +799,16 @@ private Builder setArrayValue(ValueBinder<Builder> binder, int type, Object valu
case Types.LONGNVARCHAR:
case Types.CLOB:
case Types.NCLOB:
return binder.toStringArray((Iterable<String>) null);
return binder.toStringArray(null);
case JsonType.VENDOR_TYPE_NUMBER:
return binder.toJsonArray(null);
case Types.DATE:
return binder.toDateArray((Iterable<com.google.cloud.Date>) null);
return binder.toDateArray(null);
case Types.TIME:
case Types.TIME_WITH_TIMEZONE:
case Types.TIMESTAMP:
case Types.TIMESTAMP_WITH_TIMEZONE:
return binder.toTimestampArray((Iterable<com.google.cloud.Timestamp>) null);
return binder.toTimestampArray(null);
case Types.BINARY:
case Types.VARBINARY:
case Types.LONGVARBINARY:
Expand Down Expand Up @@ -829,7 +861,11 @@ private Builder setArrayValue(ValueBinder<Builder> binder, int type, Object valu
} else if (Timestamp[].class.isAssignableFrom(value.getClass())) {
return binder.toTimestampArray(JdbcTypeConverter.toGoogleTimestamps((Timestamp[]) value));
} else if (String[].class.isAssignableFrom(value.getClass())) {
return binder.toStringArray(Arrays.asList((String[]) value));
if (type == JsonType.VENDOR_TYPE_NUMBER) {
return binder.toJsonArray(Arrays.asList((String[]) value));
} else {
return binder.toStringArray(Arrays.asList((String[]) value));
}
} else if (byte[][].class.isAssignableFrom(value.getClass())) {
return binder.toBytesArray(JdbcTypeConverter.toGoogleBytes((byte[][]) value));
}
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/com/google/cloud/spanner/jdbc/JdbcResultSet.java
Expand Up @@ -142,6 +142,8 @@ public String getString(int columnIndex) throws SQLException {
return isNull ? null : spanner.getBigDecimal(spannerIndex).toString();
case STRING:
return isNull ? null : spanner.getString(spannerIndex);
case JSON:
return isNull ? null : spanner.getJson(spannerIndex);
case TIMESTAMP:
return isNull ? null : spanner.getTimestamp(spannerIndex).toString();
case STRUCT:
Expand Down Expand Up @@ -169,6 +171,7 @@ public boolean getBoolean(int columnIndex) throws SQLException {
case STRING:
return isNull ? false : Boolean.valueOf(spanner.getString(spannerIndex));
case BYTES:
case JSON:
case DATE:
case STRUCT:
case TIMESTAMP:
Expand Down Expand Up @@ -198,6 +201,7 @@ public byte getByte(int columnIndex) throws SQLException {
case STRING:
return isNull ? (byte) 0 : checkedCastToByte(parseLong(spanner.getString(spannerIndex)));
case BYTES:
case JSON:
case DATE:
case STRUCT:
case TIMESTAMP:
Expand Down Expand Up @@ -227,6 +231,7 @@ public short getShort(int columnIndex) throws SQLException {
case STRING:
return isNull ? 0 : checkedCastToShort(parseLong(spanner.getString(spannerIndex)));
case BYTES:
case JSON:
case DATE:
case STRUCT:
case TIMESTAMP:
Expand Down Expand Up @@ -256,6 +261,7 @@ public int getInt(int columnIndex) throws SQLException {
case STRING:
return isNull ? 0 : checkedCastToInt(parseLong(spanner.getString(spannerIndex)));
case BYTES:
case JSON:
case DATE:
case STRUCT:
case TIMESTAMP:
Expand Down Expand Up @@ -283,6 +289,7 @@ public long getLong(int columnIndex) throws SQLException {
case STRING:
return isNull ? 0L : parseLong(spanner.getString(spannerIndex));
case BYTES:
case JSON:
case DATE:
case STRUCT:
case TIMESTAMP:
Expand Down Expand Up @@ -310,6 +317,7 @@ public float getFloat(int columnIndex) throws SQLException {
case STRING:
return isNull ? 0 : checkedCastToFloat(parseDouble(spanner.getString(spannerIndex)));
case BYTES:
case JSON:
case DATE:
case STRUCT:
case TIMESTAMP:
Expand Down Expand Up @@ -337,6 +345,7 @@ public double getDouble(int columnIndex) throws SQLException {
case STRING:
return isNull ? 0 : parseDouble(spanner.getString(spannerIndex));
case BYTES:
case JSON:
case DATE:
case STRUCT:
case TIMESTAMP:
Expand Down Expand Up @@ -372,6 +381,7 @@ public Date getDate(int columnIndex) throws SQLException {
case INT64:
case NUMERIC:
case BYTES:
case JSON:
case STRUCT:
case ARRAY:
default:
Expand All @@ -396,6 +406,7 @@ public Time getTime(int columnIndex) throws SQLException {
case INT64:
case NUMERIC:
case BYTES:
case JSON:
case STRUCT:
case ARRAY:
default:
Expand All @@ -421,6 +432,7 @@ public Timestamp getTimestamp(int columnIndex) throws SQLException {
case INT64:
case NUMERIC:
case BYTES:
case JSON:
case STRUCT:
case ARRAY:
default:
Expand Down Expand Up @@ -576,6 +588,7 @@ private Object getObject(Type type, int columnIndex) throws SQLException {
if (type == Type.int64()) return getLong(columnIndex);
if (type == Type.numeric()) return getBigDecimal(columnIndex);
if (type == Type.string()) return getString(columnIndex);
if (type == Type.json()) return getString(columnIndex);
if (type == Type.timestamp()) return getTimestamp(columnIndex);
if (type.getCode() == Code.ARRAY) return getArray(columnIndex);
throw JdbcSqlExceptionFactory.of(
Expand Down Expand Up @@ -664,6 +677,7 @@ private BigDecimal getBigDecimal(int columnIndex, boolean fixedScale, int scale)
e);
}
case BYTES:
case JSON:
case DATE:
case TIMESTAMP:
case STRUCT:
Expand Down Expand Up @@ -749,6 +763,7 @@ public Date getDate(int columnIndex, Calendar cal) throws SQLException {
case INT64:
case NUMERIC:
case BYTES:
case JSON:
case STRUCT:
case ARRAY:
default:
Expand Down Expand Up @@ -778,6 +793,7 @@ public Time getTime(int columnIndex, Calendar cal) throws SQLException {
case INT64:
case NUMERIC:
case BYTES:
case JSON:
case STRUCT:
case ARRAY:
default:
Expand Down Expand Up @@ -810,6 +826,7 @@ public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException
case INT64:
case NUMERIC:
case BYTES:
case JSON:
case STRUCT:
case ARRAY:
default:
Expand Down
Expand Up @@ -81,7 +81,8 @@ static Object convert(Object value, Type type, Class<?> targetType) throws SQLEx
}
if (targetType.equals(byte[].class)) {
if (type.getCode() == Code.BYTES) return value;
if (type.getCode() == Code.STRING) return ((String) value).getBytes(UTF8);
if (type.getCode() == Code.STRING || type.getCode() == Code.JSON)
return ((String) value).getBytes(UTF8);
}
if (targetType.equals(Boolean.class)) {
if (type.getCode() == Code.BOOL) return value;
Expand Down Expand Up @@ -186,6 +187,8 @@ private static Value convertToSpannerValue(Object value, Type type) throws SQLEx
case TIMESTAMP:
return Value.timestampArray(
toGoogleTimestamps((java.sql.Timestamp[]) ((java.sql.Array) value).getArray()));
case JSON:
return Value.jsonArray(Arrays.asList((String[]) ((java.sql.Array) value).getArray()));
case STRUCT:
default:
throw JdbcSqlExceptionFactory.of(
Expand All @@ -207,6 +210,8 @@ private static Value convertToSpannerValue(Object value, Type type) throws SQLEx
return Value.string((String) value);
case TIMESTAMP:
return Value.timestamp(toGoogleTimestamp((java.sql.Timestamp) value));
case JSON:
return Value.json((String) value);
case STRUCT:
default:
throw JdbcSqlExceptionFactory.of(
Expand Down

0 comments on commit ca1c906

Please sign in to comment.