|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.storage.implementation.database.GenericDataSource
This class functions as a Datasource wrapper around the JDBC Module. It is intended for use when MMBase runs outside an applicationserver, or when the server does not (or poorly) support pooled datasources. I can also be used by older systems that use the JDBC Module and do not want to change their configuration. Note that the JDBC Module will likely be fased out as a module at some point in the future, with code and supporting classes to be moved to this class instead.
| Constructor Summary | |
GenericDataSource(MMBase mmbase)
Constructs a datasource for accessing the database belonging to the given MMBase module. |
|
| Method Summary | |
java.sql.Connection |
getConnection()
Attempt to establish a database connection. |
java.sql.Connection |
getConnection(java.lang.String userName,
java.lang.String password)
Attempt to establish a database connection. |
int |
getLoginTimeout()
Gets the maximum time in seconds that this data source will wait while attempting to connect to a database. |
java.io.PrintWriter |
getLogWriter()
Get the log writer for this data source. |
void |
setLoginTimeout(int seconds)
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. |
void |
setLogWriter(java.io.PrintWriter out)
Set the log writer for this data source. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GenericDataSource(MMBase mmbase)
throws StorageInaccessibleException
mmbase - the MMBase instance
StorageInaccessibleException - if the JDBC module used in creating the datasource is inaccessible| Method Detail |
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLException - - if a database-access error occurs.
public java.sql.Connection getConnection(java.lang.String userName,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourceuserName - - the database user on whose behalf the Connection is being madepassword - - the user's password
java.sql.SQLException - - if a database-access error occurs.public int getLoginTimeout()
getLoginTimeout in interface javax.sql.DataSourcejava.sql.SQLException - - if a database-access error occurs.public java.io.PrintWriter getLogWriter()
getLogWriter in interface javax.sql.DataSourcejava.sql.SQLException - - if a database-access error occurs.public void setLoginTimeout(int seconds)
setLoginTimeout in interface javax.sql.DataSourceseconds - - the data source login time limit
java.sql.SQLException - - if a database-access error occurs.public void setLogWriter(java.io.PrintWriter out)
setLogWriter in interface javax.sql.DataSourceout - - the new log writer; to disable, set to null
java.sql.SQLException - - if a database-access error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||