|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.datasource.DriverManagerDataSource
public class DriverManagerDataSource
Wrapper to the JDBC DataSource class. Provides checking for driver class existence, and utility methods for obtaining a connection.
It should be noted that setting the log writer and login timeout will apply to DriverManager and NOT to the Data Source on its own. If you have 2 or more DataSource's they will have THE SAME log writer and login timeout.
| Constructor Summary | |
|---|---|
DriverManagerDataSource(java.lang.String driverName,
java.lang.String url,
ClassLoaderResolver clr)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Equality operator. |
java.sql.Connection |
getConnection()
Accessor for a JDBC connection for this data source. |
java.sql.Connection |
getConnection(java.lang.String userName,
java.lang.String password)
Accessor for a JDBC connection for this data source, specifying username and password. |
int |
getLoginTimeout()
Accessor for the Login timeout for the driver manager. |
java.io.PrintWriter |
getLogWriter()
Accessor for the LogWriter of the driver manager. |
int |
hashCode()
Hashcode operator. |
void |
setLoginTimeout(int seconds)
Mutator for the Login timeout for the driver manager. |
void |
setLogWriter(java.io.PrintWriter out)
Mutator for the LogWriter of the driver manager. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DriverManagerDataSource(java.lang.String driverName,
java.lang.String url,
ClassLoaderResolver clr)
driverName - Class name of the JDBC driver.url - URL of the data source.clr - ClassLoaderResolver to use for loading issues| Method Detail |
|---|
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLException - Thrown when an error occurs obtaining the connection.
public java.sql.Connection getConnection(java.lang.String userName,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourceuserName - User name for the data sourcepassword - Password for the data source
java.sql.SQLException - Thrown when an error occurs obtaining the connection.public java.io.PrintWriter getLogWriter()
getLogWriter in interface javax.sql.DataSourcepublic void setLogWriter(java.io.PrintWriter out)
setLogWriter in interface javax.sql.DataSourceout - The Log Writerpublic int getLoginTimeout()
getLoginTimeout in interface javax.sql.DataSourcepublic void setLoginTimeout(int seconds)
setLoginTimeout in interface javax.sql.DataSourceseconds - The login timeout (seconds)public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - The object to compare against.
public int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||