public class SJDataSource extends Object implements DataSource
| Modifier and Type | Field and Description |
|---|---|
private String |
driverName |
private String |
password |
private String |
poolUrl
if a connection pool has been built, its url is stored in here
|
private PrintWriter |
printWriter |
private Properties |
properties |
private String |
url |
private String |
username |
| Constructor and Description |
|---|
SJDataSource(String driverName,
String url,
String username,
String password,
Properties properties) |
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
ensureLoaded(String name) |
boolean |
equals(Object obj) |
Connection |
getConnection() |
Connection |
getConnection(String username,
String password)
With every call a new connection is returned unless property "pool" was set.
|
private Connection |
getConnection(String username,
String password,
String tmpUrl) |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
Logger |
getParentLogger() |
int |
hashCode() |
boolean |
isWrapperFor(Class<?> iface) |
void |
setLoginTimeout(int timeout) |
void |
setLogWriter(PrintWriter pw) |
String |
toString() |
<T> T |
unwrap(Class<T> iface) |
private PrintWriter printWriter
private String username
private String password
private String url
private String driverName
private Properties properties
private String poolUrl
public SJDataSource(String driverName, String url, String username, String password, Properties properties)
private static boolean ensureLoaded(String name)
public Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptiongetConnection(String, String)public Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionprivate Connection getConnection(String username, String password, String tmpUrl) throws SQLException
SQLExceptionpublic PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic void setLogWriter(PrintWriter pw) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic void setLoginTimeout(int timeout)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionCopyright © 2020. All rights reserved.