| Modifier and Type | Field and Description |
|---|---|
static int |
DEBUG |
static int |
INFO |
static int |
OFF |
| Constructor and Description |
|---|
CloudSpannerDriver() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptsURL(String url) |
void |
closeSpanner()
Closes all connections to Google Cloud Spanner that have been opened by this driver during the
lifetime of this application.
|
CloudSpannerConnection |
connect(String url,
Properties info)
Connects to a Google Cloud Spanner database.
|
static void |
deregister()
According to JDBC specification, this driver is registered against
DriverManager when
the class is loaded. |
static CloudSpannerDriver |
getDriver() |
static int |
getDriverMajorVersion() |
static int |
getDriverMinorVersion() |
static int |
getLogLevel() |
static long |
getLongTransactionTrigger() |
int |
getMajorVersion() |
int |
getMinorVersion() |
Logger |
getParentLogger() |
DriverPropertyInfo[] |
getPropertyInfo(String url,
Properties info) |
static String |
getVersion() |
static boolean |
isRegistered() |
boolean |
jdbcCompliant() |
static String |
quoteIdentifier(String identifier) |
static void |
register()
Register the driver against
DriverManager. |
static void |
setLogLevel(int logLevel) |
static void |
setLongTransactionTrigger(long trigger)
Sets the number of milliseconds that should be used to consider a transaction long-running.
|
static String |
unquoteIdentifier(String identifier) |
public static final int DEBUG
public static final int INFO
public static final int OFF
public static CloudSpannerDriver getDriver()
CloudSpannerDriverpublic CloudSpannerConnection connect(String url, Properties info) throws SQLException
connect in interface Driverurl - Connection URL in the form jdbc:cloudspanner://localhost;Project
=projectId;Instance=instanceId ;Database=databaseName;PvtKeyPath
=path_to_key_file;SimulateProductName=product_nameinfo - Additional connection properties that will be set on the new connectionCloudSpannerConnectionSQLException - if an error occurs while connecting to Google Cloud Spannerpublic void closeSpanner()
public boolean acceptsURL(String url) throws SQLException
acceptsURL in interface DriverSQLExceptionpublic DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
getPropertyInfo in interface DriverSQLExceptionpublic int getMajorVersion()
getMajorVersion in interface Driverpublic static int getDriverMajorVersion()
public int getMinorVersion()
getMinorVersion in interface Driverpublic static int getDriverMinorVersion()
public static String getVersion()
public boolean jdbcCompliant()
jdbcCompliant in interface Driverpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface DriverSQLFeatureNotSupportedExceptionpublic static long getLongTransactionTrigger()
public static void setLongTransactionTrigger(long trigger)
DriverManager.setLogWriter(java.io.PrintWriter) and the log level of the Cloud Spanner
Driver has been set to at least INFO, transactions that are running for more than this number
of milliseconds will log this to the log writer. If the log level of the Cloud Spanner Driver
is set to at least DEBUG, then the driver will also log the stack trace of the call that
started the transaction, making it easier to find the part of your code that is responsible for
the long-running transaction.trigger - The number of milliseconds that is to be considered a long-running transaction.
Only values larger than zero are allowed.public static void setLogLevel(int logLevel)
public static int getLogLevel()
public static void register()
throws SQLException
DriverManager. This is done automatically when the class is
loaded. Dropping the driver from DriverManager's list is possible using deregister()
method.IllegalStateException - if the driver is already registeredSQLException - if registering the driver failspublic static void deregister()
throws SQLException
DriverManager when
the class is loaded. To avoid leaks, this method allow unregistering the driver so that the
class can be gc'ed if necessary.IllegalStateException - if the driver is not registeredSQLException - if deregistering the driver failspublic static boolean isRegistered()
true if the driver is registered against DriverManagerCopyright © 2020. All rights reserved.