|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.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,
java.lang.String userName,
java.lang.String password,
org.datanucleus.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. |
boolean |
isWrapperFor(java.lang.Class iface)
|
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. |
java.lang.Object |
unwrap(java.lang.Class iface)
|
| 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,
java.lang.String userName,
java.lang.String password,
org.datanucleus.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 source (this user name is ignored)password - Password for the data source (this password is ignored)
java.sql.SQLException - Thrown when an error occurs obtaining the connection.public java.io.PrintWriter getLogWriter()
getLogWriter in interface javax.sql.CommonDataSourcepublic void setLogWriter(java.io.PrintWriter out)
setLogWriter in interface javax.sql.CommonDataSourceout - The Log Writerpublic int getLoginTimeout()
getLoginTimeout in interface javax.sql.CommonDataSourcepublic void setLoginTimeout(int seconds)
setLoginTimeout in interface javax.sql.CommonDataSourceseconds - 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
public java.lang.Object unwrap(java.lang.Class iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLException
public boolean isWrapperFor(java.lang.Class iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||