public class SimpleDataSource extends Object implements DataSource
| Modifier and Type | Field and Description |
|---|---|
protected int |
loginTimeout |
protected PrintWriter |
logWriter |
protected EventMap<String,String> |
properties |
protected PropertyChangeSupport |
psupport |
protected String |
url |
| Constructor and Description |
|---|
SimpleDataSource() |
SimpleDataSource(SimpleDataSource sample) |
SimpleDataSource(String url) |
SimpleDataSource(String url,
Properties props) |
SimpleDataSource(String url,
String username,
String password) |
protected final transient PropertyChangeSupport psupport
protected String url
protected int loginTimeout
protected transient PrintWriter logWriter
public SimpleDataSource()
public SimpleDataSource(String url)
public SimpleDataSource(String url, Properties props)
public SimpleDataSource(SimpleDataSource sample)
public void addPropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
public PropertyChangeListener[] getPropertyChangeListeners()
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
public void firePropertyChange(String propertyName, Object oldValue, Object newValue)
public boolean hasListeners(String propertyName)
public void assign(SimpleDataSource ds)
public SimpleDataSource clone()
public String getUrl()
public void setUrl(String url)
public EventMap<String,String> properties()
public String getUsername()
public void setUsername(String name)
public String getPassword()
public void setPassword(String pswd)
pswd - Пароль или nullpublic void setLoginTimeout(int seconds)
throws SQLException
По умолчанию 60 секунд
setLoginTimeout in interface CommonDataSourceseconds - таймаут в секундахSQLException - Данная ошибка не генерируется этим методомpublic int getLoginTimeout()
throws SQLException
По умолчанию 60 секунд
getLoginTimeout in interface CommonDataSourceSQLException - Данная ошибка не генерируется этим методомpublic PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic 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 WrapperSQLExceptionCopyright © 2018. All rights reserved.