public class SingleStoreDataSource extends Object implements DataSource, ConnectionPoolDataSource, XADataSource
| Constructor and Description |
|---|
SingleStoreDataSource(String url) |
| Modifier and Type | Method and Description |
|---|---|
Connection |
getConnection()
Attempts to establish a connection with the data source that this
DataSource object
represents. |
Connection |
getConnection(String username,
String password)
Attempts to establish a connection with the data source that this
DataSource object
represents. |
int |
getLoginTimeout()
Gets the maximum time in seconds that this data source can wait while attempting to connect to
a database.
|
PrintWriter |
getLogWriter()
Implementation doesn't use logwriter
|
Logger |
getParentLogger()
Not implemented
|
PooledConnection |
getPooledConnection() |
PooledConnection |
getPooledConnection(String username,
String password) |
XAConnection |
getXAConnection() |
XAConnection |
getXAConnection(String username,
String password) |
boolean |
isWrapperFor(Class<?> iface)
Returns true if this either implements the interface argument or is directly or indirectly a
wrapper for an object that does.
|
void |
setLoginTimeout(int seconds)
Sets the maximum time in seconds that this data source will wait while attempting to connect to
a database.
|
void |
setLogWriter(PrintWriter out)
Implementation doesn't use logwriter
|
<T> T |
unwrap(Class<T> iface)
Returns an object that implements the given interface to allow access to non-standard methods,
or standard methods not exposed by the proxy.
|
public SingleStoreDataSource(String url) throws SQLException
SQLExceptionpublic Connection getConnection() throws SQLException
DataSource object
represents.getConnection in interface DataSourceSQLException - if a database access error occursSQLTimeoutException - when the driver has determined that the timeout value specified by
the setLoginTimeout method has been exceeded and has at least tried to cancel the
current database connection attemptpublic Connection getConnection(String username, String password) throws SQLException
DataSource object
represents.getConnection in interface DataSourceusername - the database user on whose behalf the connection is being madepassword - the user's passwordSQLException - if a database access error occursSQLTimeoutException - when the driver has determined that the timeout value specified by
the setLoginTimeout method has been exceeded and has at least tried to cancel the
current database connection attemptpublic <T> T unwrap(Class<T> iface) throws SQLException
If the receiver implements the interface then the result is the receiver or a proxy for the
receiver. If the receiver is a wrapper and the wrapped object implements the interface then the
result is the wrapped object or a proxy for the wrapped object. Otherwise return the the result
of calling unwrap recursively on the wrapped object or a proxy for that result. If
the receiver is not a wrapper and does not implement the interface, then an SQLException
is thrown.
unwrap in interface Wrapperiface - A Class defining an interface that the result must implement.SQLException - If no object found that implements the interfacepublic boolean isWrapperFor(Class<?> iface)
isWrapperFor on the wrapped object. If this does not implement the interface and is not
a wrapper, return false. This method should be implemented as a low-cost operation compared to
unwrap so that callers can use this method to avoid expensive unwrap
calls that may fail. If this method returns true then calling unwrap with the same
argument should succeed.isWrapperFor in interface Wrapperiface - a Class defining an interface.public PrintWriter getLogWriter()
getLogWriter in interface CommonDataSourcesetLogWriter(java.io.PrintWriter)public void setLogWriter(PrintWriter out)
setLogWriter in interface CommonDataSourceout - the new log writer; to disable logging, set to nullgetLogWriter()public int getLoginTimeout()
DataSource object is
created, the login timeout is initially to 30s.getLoginTimeout in interface CommonDataSourcesetLoginTimeout(int)public void setLoginTimeout(int seconds)
DataSource object
is created, the login timeout is initially 30s.setLoginTimeout in interface CommonDataSourceseconds - the data source login time limitgetLoginTimeout()public Logger getParentLogger()
getParentLogger in interface CommonDataSourcepublic PooledConnection getPooledConnection() throws SQLException
getPooledConnection in interface ConnectionPoolDataSourceSQLExceptionpublic PooledConnection getPooledConnection(String username, String password) throws SQLException
getPooledConnection in interface ConnectionPoolDataSourceSQLExceptionpublic XAConnection getXAConnection() throws SQLException
getXAConnection in interface XADataSourceSQLExceptionpublic XAConnection getXAConnection(String username, String password) throws SQLException
getXAConnection in interface XADataSourceSQLExceptionCopyright © 2023 SingleStore. All rights reserved.