public class SimpleDataSource extends Object implements IDataSourceProvider, DataSource
| Constructor and Description |
|---|
SimpleDataSource(String driver,
String url,
String user,
String password)
Creates a basic datasource.
|
| Modifier and Type | Method and Description |
|---|---|
protected Connection |
get(String driver,
String url,
String user,
String pwd)
Gets a connection from connection parameters.
|
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
DataSource |
getDataSource()
Returns the data source target for scripts execution.
|
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
Logger |
getParentLogger() |
boolean |
isWrapperFor(Class<?> iface) |
void |
release()
Release data source resources.
|
void |
setLoginTimeout(int seconds) |
void |
setLogWriter(PrintWriter out) |
String |
toString() |
<T> T |
unwrap(Class<T> iface) |
public DataSource getDataSource()
IDataSourceProvidergetDataSource in interface IDataSourceProviderpublic void release()
IDataSourceProviderrelease in interface IDataSourceProviderpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic void setLoginTimeout(int seconds)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionprotected Connection get(String driver, String url, String user, String pwd) throws SQLException
driver - The driver.url - The URL.user - The user.pwd - The password.SQLException - On connection errors.public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionCopyright © 2017. All rights reserved.