public class JdbcDataSource extends Object implements DataSource
DataSource
implementation for Google Cloud Spanner.Constructor and Description |
---|
JdbcDataSource() |
Modifier and Type | Method and Description |
---|---|
Boolean |
getAutocommit() |
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
String |
getCredentials() |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
Logger |
getParentLogger() |
Boolean |
getReadonly() |
Boolean |
getRetryAbortsInternally() |
String |
getUrl() |
boolean |
isClosed()
Should return true if this object has been closed
|
boolean |
isWrapperFor(Class<?> iface) |
void |
setAutocommit(Boolean autocommit) |
void |
setCredentials(String credentials) |
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
void |
setReadonly(Boolean readonly) |
void |
setRetryAbortsInternally(Boolean retryAbortsInternally) |
void |
setUrl(String url) |
<T> T |
unwrap(Class<T> iface) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isWrapperFor, unwrap
public PrintWriter getLogWriter()
getLogWriter
in interface CommonDataSource
public void setLogWriter(PrintWriter out)
setLogWriter
in interface CommonDataSource
public void setLoginTimeout(int seconds)
setLoginTimeout
in interface CommonDataSource
public int getLoginTimeout()
getLoginTimeout
in interface CommonDataSource
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface CommonDataSource
SQLFeatureNotSupportedException
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
SQLException
public boolean isClosed()
public String getUrl()
DataSource
.public void setUrl(String url)
url
- The JDBC URL to use for this DataSource
.public String getCredentials()
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.public void setCredentials(String credentials)
credentials
- 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.public Boolean getAutocommit()
DataSource
. If autocommit is
specified in both the connection URL and using this property, the value in the connection
URL will be used.public void setAutocommit(Boolean autocommit)
autocommit
- 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.public Boolean getReadonly()
DataSource
. If readonly is
specified in both the connection URL and using this property, the value in the connection
URL will be used.public void setReadonly(Boolean readonly)
readonly
- 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.public Boolean getRetryAbortsInternally()
DataSource
. If
retryAbortsInternally is specified in both the connection URL and using this property, the
value in the connection URL will be used.public void setRetryAbortsInternally(Boolean retryAbortsInternally)
retryAbortsInternally
- 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.public boolean isWrapperFor(Class<?> iface)
isWrapperFor
in interface Wrapper
public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
in interface Wrapper
SQLException
Copyright © 2023 Google LLC. All rights reserved.