public class SJDataSource
extends java.lang.Object
implements javax.sql.DataSource
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
driver |
private java.lang.String |
password |
private java.lang.String |
poolUrl
if a connection pool has been built, its url is stored in here
|
private java.util.Properties |
properties |
private java.io.PrintWriter |
pw |
private java.lang.String |
url |
private java.lang.String |
username |
Constructor and Description |
---|
SJDataSource(java.lang.String driver,
java.lang.String url,
java.lang.String username,
java.lang.String password,
java.util.Properties properties) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
ensureLoaded(java.lang.String name) |
boolean |
equals(java.lang.Object obj) |
java.sql.Connection |
getConnection() |
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
returns a connection to the database specified in the properties and
creates a connection pool, if neccessary
|
int |
getLoginTimeout() |
java.io.PrintWriter |
getLogWriter() |
java.util.logging.Logger |
getParentLogger() |
int |
hashCode() |
boolean |
isWrapperFor(java.lang.Class<?> iface) |
void |
setLoginTimeout(int timeout) |
void |
setLogWriter(java.io.PrintWriter pw) |
java.lang.String |
toString() |
<T> T |
unwrap(java.lang.Class<T> iface) |
private java.io.PrintWriter pw
private java.lang.String username
private java.lang.String password
private java.lang.String url
private java.lang.String driver
private java.util.Properties properties
private java.lang.String poolUrl
public SJDataSource(java.lang.String driver, java.lang.String url, java.lang.String username, java.lang.String password, java.util.Properties properties)
private static boolean ensureLoaded(java.lang.String name)
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter pw) throws java.sql.SQLException
setLogWriter
in interface javax.sql.CommonDataSource
java.sql.SQLException
public void setLoginTimeout(int timeout) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.CommonDataSource
java.sql.SQLException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
in interface java.sql.Wrapper
java.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
in interface java.sql.Wrapper
java.sql.SQLException
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
getParentLogger
in interface javax.sql.CommonDataSource
java.sql.SQLFeatureNotSupportedException