Package com.google.cloud.spanner.jdbc
Class JdbcDataSource
java.lang.Object
com.google.cloud.spanner.jdbc.JdbcDataSource
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource
DataSource implementation for Google Cloud Spanner.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetConnection(String username, String password) intgetUrl()booleanisClosed()Should return true if this object has been closedbooleanisWrapperFor(Class<?> iface) voidsetAutocommit(Boolean autocommit) voidsetCredentials(String credentials) voidsetLoginTimeout(int seconds) voidsetLogWriter(PrintWriter out) voidsetReadonly(Boolean readonly) voidsetRetryAbortsInternally(Boolean retryAbortsInternally) void<T> TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Constructor Details
-
JdbcDataSource
public JdbcDataSource()
-
-
Method Details
-
getLogWriter
- Specified by:
getLogWriterin interfaceCommonDataSource
-
setLogWriter
- Specified by:
setLogWriterin interfaceCommonDataSource
-
setLoginTimeout
public void setLoginTimeout(int seconds) - Specified by:
setLoginTimeoutin interfaceCommonDataSource
-
getLoginTimeout
public int getLoginTimeout()- Specified by:
getLoginTimeoutin interfaceCommonDataSource
-
getParentLogger
- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
isClosed
public boolean isClosed()Should return true if this object has been closed -
getUrl
- Returns:
- the JDBC URL to use for this
DataSource.
-
setUrl
- Parameters:
url- The JDBC URL to use for thisDataSource.
-
getCredentials
- Returns:
- the credentials URL to use for this
DataSource. If a credentials URL is specified in both the connection URL and using this property, the value in the connection URL will be used.
-
setCredentials
- Parameters:
credentials- The credentials URL to use for thisDataSource. If a credentials URL is specified in both the connection URL and using this property, the value in the connection URL will be used.
-
getAutocommit
- Returns:
- the initial autocommit setting to use for this
DataSource. If autocommit is specified in both the connection URL and using this property, the value in the connection URL will be used.
-
setAutocommit
- Parameters:
autocommit- The initial autocommit setting to use for thisDataSource. If autocommit is specified in both the connection URL and using this property, the value in the connection URL will be used.
-
getReadonly
- Returns:
- the initial readonly setting to use for this
DataSource. If readonly is specified in both the connection URL and using this property, the value in the connection URL will be used.
-
setReadonly
- Parameters:
readonly- The initial readonly setting to use for thisDataSource. If readonly is specified in both the connection URL and using this property, the value in the connection URL will be used.
-
getRetryAbortsInternally
- Returns:
- the initial retryAbortsInternally setting to use for this
DataSource. If retryAbortsInternally is specified in both the connection URL and using this property, the value in the connection URL will be used.
-
setRetryAbortsInternally
- Parameters:
retryAbortsInternally- The initial retryAbortsInternally setting to use for thisDataSource. If retryAbortsInternally is specified in both the connection URL and using this property, the value in the connection URL will be used.
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-