public class DefaultBasicDataSource extends Object implements BasicDataSource
BasicDataSource implementation.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultBasicDataSource.DefaultBuilder
Default
Builder implementation. |
BasicDataSource.Builder| Constructor and Description |
|---|
DefaultBasicDataSource() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
Properties |
getConnectionProperties()
Connection properties to be passed to the Driver
|
int |
getLoginTimeout()
Returns 0, indicating the default system timeout is to be used.
|
PrintWriter |
getLogWriter()
LogWriter methods are not supported.
|
Logger |
getParentLogger() |
String |
getPassword()
JDBC connection password
|
String |
getUrl()
JDBC URL to use to use for connections
|
String |
getUsername()
JDBC connection username
|
boolean |
isWrapperFor(Class<?> iface) |
void |
setConnectionProperties(Properties connectionProperties)
Specify arbitrary connection properties as key/value pairs to be passed to the Driver.
|
void |
setDriverClass(Class<? extends Driver> driverClass)
Set JDBC Driver class to use
|
void |
setDriverClassName(String driverClassName)
Set JDBC Driver class name to use
|
void |
setLoginTimeout(int seconds)
Setting a login timeout is not supported.
|
void |
setLogWriter(PrintWriter out)
LogWriter methods are not supported.
|
void |
setPassword(String password)
Set JDBC connection password
|
void |
setUrl(String url)
Set JDBC URL to use for connections
|
void |
setUsername(String username)
Set JDBC connection username
|
<T> T |
unwrap(Class<T> iface) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuilderpublic void setUrl(String url)
url - Connection URLDriver.connect(String, java.util.Properties)public String getUrl()
public void setUsername(String username)
username - JDBC connection usernameDriver.connect(String, java.util.Properties)public String getUsername()
public void setPassword(String password)
password - JDBC connection passwordDriver.connect(String, java.util.Properties)public String getPassword()
public void setDriverClassName(String driverClassName)
driverClassName - JDBC Driver class namepublic void setDriverClass(Class<? extends Driver> driverClass)
driverClass - JDBC Driver classpublic void setConnectionProperties(Properties connectionProperties)
connectionProperties - Connection propertiesDriver.connect(String, java.util.Properties)public Properties getConnectionProperties()
public PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2019 The Holon Platform. All rights reserved.