# Package com.google.cloud.spanner.jdbc

A JDBC driver for Cloud Spanner - A no-compromise relational database service.

See: Description

Interface Summary
CloudSpannerJdbcConnection: JDBC connection with a number of additional Cloud Spanner specific methods.
JdbcSqlException: Base interface for all Cloud Spanner `SQLException`s.
TransactionRetryListener: Deprecated

Class Summary
JdbcConstants: Constants for special values used by the Cloud Spanner JDBC driver.
JdbcDataSource: `DataSource` implementation for Google Cloud Spanner.
JdbcDriver: JDBC `Driver` for Google Cloud Spanner.
JdbcSqlExceptionFactory: Factory class for creating `SQLException`s for Cloud Spanner
JsonType: Custom SQL type for Spanner JSON data type.
PgJsonbType
SpannerPool: Deprecated

Enum Summary
TransactionRetryListener.RetryResult: Deprecated

Exception Summary
JdbcSqlExceptionFactory.JdbcAbortedDueToConcurrentModificationException: Specific `SQLException` that is thrown when a transaction was aborted and could not be retried due to a concurrent modification.
JdbcSqlExceptionFactory.JdbcAbortedException: Specific `SQLException` that is thrown when a transaction was aborted and could not be successfully retried.
JdbcSqlExceptionFactory.JdbcSqlBatchUpdateException: Specific `SQLException` that is thrown when a `SpannerBatchUpdateException` occurs.
JdbcSqlExceptionFactory.JdbcSqlClientInfoException: Specific `SQLException` that is thrown when setting client info on a connection
JdbcSqlExceptionFactory.JdbcSqlExceptionImpl: Base `SQLException` for Cloud Spanner
JdbcSqlExceptionFactory.JdbcSqlFeatureNotSupportedException: Specific `SQLException` that is thrown for unsupported methods and values
JdbcSqlExceptionFactory.JdbcSqlTimeoutException: Specific `SQLException` that is thrown when a statement times out

## Package com.google.cloud.spanner.jdbc Description

A JDBC driver for Cloud Spanner - A no-compromise relational database service.

Example for creating a JDBC connection to Cloud Spanner.

     String projectId = "my-project";
     String instanceId = "my-instance";
     String databaseId = "my-database";

     try (Connection connection =
         DriverManager.getConnection(
             String.format(
                 "jdbc:cloudspanner:/projects/%s/instances/%s/databases/%s",
                 projectId, instanceId, databaseId))) {
       try (Statement statement = connection.createStatement()) {
         try (ResultSet rs = statement.executeQuery("SELECT CURRENT_TIMESTAMP()")) {
           while (rs.next()) {
             System.out.printf(
                 "Connected to Cloud Spanner at [%s]%n", rs.getTimestamp(1).toString());
           }
         }
       }
     }

See Also:
  JdbcDriver java doc for all supported connection URL properties., Cloud Spanner JDBC Driver