Google offers an open-source JDBC driver for Cloud Spanner. The open-source driver enables applications to access Cloud Spanner through the Java Database Connectivity (JDBC) API.
This page answers frequently asked questions about the open-source JDBC driver. To learn how to use the driver, see Using the open-source JDBC driver.
Can I use this driver to issue Data Manipulation Language (DML) and Data Definition Language (DDL) statements?
Yes, this driver supports DML and DDL statements.
How does this driver deal with Cloud Spanner parent-child or interleaved table relationships?
Interleaved table relationships are mapped to foreign key relationships in JDBC.
In Cloud Spanner, a record in the child table interleaved with a parent has
its primary key dependent on the associated parent table record's primary key.
Cloud Spanner defines the child table's parent primary key portion of its
primary key as the foreign key, referencing the parent table's primary key. Thus
you can navigate the interleaved table relationships using the foreign key
metadata calls in
DatabaseMetaData. You can read more details in
Schema and data model.
Are all Cloud Spanner data types supported by this driver?
The open-source JDBC driver does not support Cloud Spanner's
type. All other types have appropriate mappings.
Does this driver support indexes?
Yes. You can use indexes in
SELECT queries using the appropriate
query syntax. The open-source driver can also
create and modify indexes as DDL statements. You can access information about
particular indexes using the
Does this driver support parameterized queries?
Yes, this driver supports positional parameterization.
Are there other limitations to consider when using this driver?
This driver's capabilities have limits defined by the underlying system. See the quotas and limits for Cloud Spanner.
How do I get support for this driver?
Consult our support page for support options.