Class JdbcDataSource (2.16.1)

public class JdbcDataSource extends AbstractJdbcWrapper implements DataSource

DataSource implementation for Google Cloud Spanner.

Inheritance

java.lang.Object > com.google.cloud.spanner.jdbc.AbstractJdbcWrapper > JdbcDataSource

Implements

DataSource

Constructors

JdbcDataSource()

public JdbcDataSource()

Methods

getAutocommit()

public Boolean getAutocommit()
Returns
TypeDescription
Boolean

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.

getConnection()

public Connection getConnection()
Returns
TypeDescription
Connection
Exceptions
TypeDescription
SQLException

getConnection(String username, String password)

public Connection getConnection(String username, String password)
Parameters
NameDescription
usernameString
passwordString
Returns
TypeDescription
Connection
Exceptions
TypeDescription
SQLException

getCredentials()

public String getCredentials()
Returns
TypeDescription
String

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.

getLogWriter()

public PrintWriter getLogWriter()
Returns
TypeDescription
PrintWriter

getLoginTimeout()

public int getLoginTimeout()
Returns
TypeDescription
int

getParentLogger()

public Logger getParentLogger()
Returns
TypeDescription
Logger
Exceptions
TypeDescription
SQLFeatureNotSupportedException

getReadonly()

public Boolean getReadonly()
Returns
TypeDescription
Boolean

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.

getRetryAbortsInternally()

public Boolean getRetryAbortsInternally()
Returns
TypeDescription
Boolean

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.

getUrl()

public String getUrl()
Returns
TypeDescription
String

the JDBC URL to use for this DataSource.

isClosed()

public boolean isClosed()

Should return true if this object has been closed

Returns
TypeDescription
boolean
Overrides
com.google.cloud.spanner.jdbc.AbstractJdbcWrapper.isClosed()

setAutocommit(Boolean autocommit)

public void setAutocommit(Boolean autocommit)
Parameter
NameDescription
autocommitBoolean

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.

setCredentials(String credentials)

public void setCredentials(String credentials)
Parameter
NameDescription
credentialsString

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.

setLogWriter(PrintWriter out)

public void setLogWriter(PrintWriter out)
Parameter
NameDescription
outPrintWriter

setLoginTimeout(int seconds)

public void setLoginTimeout(int seconds)
Parameter
NameDescription
secondsint

setReadonly(Boolean readonly)

public void setReadonly(Boolean readonly)
Parameter
NameDescription
readonlyBoolean

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.

setRetryAbortsInternally(Boolean retryAbortsInternally)

public void setRetryAbortsInternally(Boolean retryAbortsInternally)
Parameter
NameDescription
retryAbortsInternallyBoolean

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.

setUrl(String url)

public void setUrl(String url)
Parameter
NameDescription
urlString

The JDBC URL to use for this DataSource.