|
||||||||||
| 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(String driverName,
String url,
String userName,
String password,
org.datanucleus.ClassLoaderResolver clr,
Properties props)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Equality operator. |
Connection |
getConnection()
Accessor for a JDBC connection for this data source. |
Connection |
getConnection(String userName,
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. |
PrintWriter |
getLogWriter()
Accessor for the LogWriter of the driver manager. |
Logger |
getParentLogger()
|
int |
hashCode()
Hashcode operator. |
boolean |
isWrapperFor(Class iface)
|
void |
setLoginTimeout(int seconds)
Mutator for the Login timeout for the driver manager. |
void |
setLogWriter(PrintWriter out)
Mutator for the LogWriter of the driver manager. |
Object |
unwrap(Class iface)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DriverManagerDataSource(String driverName,
String url,
String userName,
String password,
org.datanucleus.ClassLoaderResolver clr,
Properties props)
driverName - Class name of the JDBC driver.url - URL of the data source.clr - ClassLoaderResolver to use for loading issuesprops - Any custom properties for the driver| Method Detail |
|---|
public Connection getConnection()
throws SQLException
getConnection in interface DataSourceSQLException - Thrown when an error occurs obtaining the connection.
public Connection getConnection(String userName,
String password)
throws SQLException
getConnection in interface DataSourceuserName - User name for the data source (this user name is ignored)password - Password for the data source (this password is ignored)
SQLException - Thrown when an error occurs obtaining the connection.public PrintWriter getLogWriter()
getLogWriter in interface CommonDataSourcepublic void setLogWriter(PrintWriter out)
setLogWriter in interface CommonDataSourceout - The Log Writerpublic int getLoginTimeout()
getLoginTimeout in interface CommonDataSourcepublic void setLoginTimeout(int seconds)
setLoginTimeout in interface CommonDataSourceseconds - The login timeout (seconds)public boolean equals(Object obj)
equals in class Objectobj - The object to compare against.
public int hashCode()
hashCode in class Object
public Object unwrap(Class iface)
throws SQLException
unwrap in interface WrapperSQLException
public boolean isWrapperFor(Class iface)
throws SQLException
isWrapperFor in interface WrapperSQLException
public Logger getParentLogger()
throws SQLFeatureNotSupportedException
SQLFeatureNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||