|
|||||||||
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 DataSource implementation wrapping a JDBC driver.
Field Summary | |
---|---|
protected java.lang.String |
connectionUrl
|
protected java.sql.Driver |
driver
|
protected ConnectionEventLoggingDelegate |
logger
|
protected java.lang.String |
password
|
protected java.lang.String |
userName
|
Constructor Summary | |
---|---|
DriverDataSource(java.sql.Driver driver,
java.lang.String connectionUrl,
java.lang.String userName,
java.lang.String password)
Creates a new DriverDataSource wrapping a given Driver. |
|
DriverDataSource(java.lang.String driverClassName,
java.lang.String connectionUrl)
Creates a new DriverDataSource. |
Method Summary | |
---|---|
java.sql.Connection |
getConnection()
Returns a new database connection, using preconfigured data to locate the database and obtain a connection. |
java.sql.Connection |
getConnection(java.lang.String userName,
java.lang.String password)
Returns a new database connection using provided credentials to login to the database. |
ConnectionEventLoggingDelegate |
getLogger()
|
int |
getLoginTimeout()
|
java.io.PrintWriter |
getLogWriter()
|
void |
setLogger(ConnectionEventLoggingDelegate delegate)
|
void |
setLoginTimeout(int seconds)
|
void |
setLogWriter(java.io.PrintWriter out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.sql.Driver driver
protected java.lang.String connectionUrl
protected java.lang.String userName
protected java.lang.String password
protected ConnectionEventLoggingDelegate logger
Constructor Detail |
---|
public DriverDataSource(java.lang.String driverClassName, java.lang.String connectionUrl) throws java.sql.SQLException
java.sql.SQLException
public DriverDataSource(java.sql.Driver driver, java.lang.String connectionUrl, java.lang.String userName, java.lang.String password)
Method Detail |
---|
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 int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.DataSource
java.sql.SQLException
public void setLoginTimeout(int seconds) throws java.sql.SQLException
setLoginTimeout
in interface javax.sql.DataSource
java.sql.SQLException
public java.io.PrintWriter getLogWriter() throws java.sql.SQLException
getLogWriter
in interface javax.sql.DataSource
java.sql.SQLException
public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
setLogWriter
in interface javax.sql.DataSource
java.sql.SQLException
public ConnectionEventLoggingDelegate getLogger()
public void setLogger(ConnectionEventLoggingDelegate delegate)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |