|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.conn.DriverDataSource
public class DriverDataSource
A non-pooling DataSource implementation wrapping a JDBC driver.
Field Summary | |
---|---|
protected String |
connectionUrl
|
protected Driver |
driver
|
protected ConnectionEventLoggingDelegate |
logger
|
protected String |
password
|
protected String |
userName
|
Constructor Summary | |
---|---|
DriverDataSource(Driver driver,
String connectionUrl,
String userName,
String password)
Creates a new DriverDataSource wrapping a given Driver. |
|
DriverDataSource(String driverClassName,
String connectionUrl)
Creates a new DriverDataSource. |
|
DriverDataSource(String driverClassName,
String connectionUrl,
String userName,
String password)
Creates a new DriverDataSource. |
Method Summary | ||
---|---|---|
Connection |
getConnection()
Returns a new database connection, using preconfigured data to locate the database and obtain a connection. |
|
Connection |
getConnection(String userName,
String password)
Returns a new database connection using provided credentials to login to the database. |
|
String |
getConnectionUrl()
|
|
String |
getDriverClassName()
|
|
ConnectionEventLoggingDelegate |
getLogger()
|
|
int |
getLoginTimeout()
|
|
PrintWriter |
getLogWriter()
|
|
String |
getPassword()
|
|
String |
getUserName()
|
|
boolean |
isWrapperFor(Class<?> iface)
|
|
void |
setConnectionUrl(String connectionUrl)
|
|
void |
setDriverClassName(String driverClassName)
|
|
void |
setLogger(ConnectionEventLoggingDelegate delegate)
|
|
void |
setLoginTimeout(int seconds)
|
|
void |
setLogWriter(PrintWriter out)
|
|
void |
setPassword(String password)
|
|
void |
setUserName(String userName)
|
|
|
unwrap(Class<T> iface)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Driver driver
protected String connectionUrl
protected String userName
protected String password
protected ConnectionEventLoggingDelegate logger
Constructor Detail |
---|
public DriverDataSource(String driverClassName, String connectionUrl) throws SQLException
SQLException
public DriverDataSource(String driverClassName, String connectionUrl, String userName, String password) throws SQLException
SQLException
public DriverDataSource(Driver driver, String connectionUrl, String userName, String password)
Method Detail |
---|
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 int getLoginTimeout() throws SQLException
getLoginTimeout
in interface DataSource
SQLException
public void setLoginTimeout(int seconds) throws SQLException
setLoginTimeout
in interface DataSource
SQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface DataSource
SQLException
public void setLogWriter(PrintWriter out) throws SQLException
setLogWriter
in interface DataSource
SQLException
public ConnectionEventLoggingDelegate getLogger()
public void setLogger(ConnectionEventLoggingDelegate delegate)
public String getConnectionUrl()
public void setConnectionUrl(String connectionUrl)
public String getPassword()
public void setPassword(String password)
public String getUserName()
public void setUserName(String userName)
public String getDriverClassName()
public void setDriverClassName(String driverClassName) throws SQLException
SQLException
public boolean isWrapperFor(Class<?> iface) throws SQLException
SQLException
public <T> T unwrap(Class<T> iface) throws SQLException
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |