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, wait
builder
public 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 CommonDataSource
SQLException
public void setLogWriter(PrintWriter out) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface CommonDataSource
SQLException
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface CommonDataSource
SQLException
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface CommonDataSource
SQLFeatureNotSupportedException
public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
in interface Wrapper
SQLException
public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
in interface Wrapper
SQLException
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 void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2020 The Holon Platform. All rights reserved.