|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.easybeans.ds.DummyDataSource
public class DummyDataSource
Defines a dummy datasource implementation based on HSQL in memory server.
Field Summary | |
---|---|
private static long |
serialVersionUID
Id for serializable class. |
Constructor Summary | |
---|---|
DummyDataSource()
Constructor. Init the driver. |
Method Summary | |
---|---|
java.sql.Connection |
getConnection()
Attempts to establish a connection with the data source that this DataSource object represents. |
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
Attempts to establish a connection with the data source that this DataSource object represents. |
int |
getLoginTimeout()
Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. |
java.io.PrintWriter |
getLogWriter()
Retrieves the log writer for this DataSource
object. |
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)
Sets the log writer for this DataSource
object to the given java.io.PrintWriter object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
Constructor Detail |
---|
public DummyDataSource()
Method Detail |
---|
public java.sql.Connection getConnection() throws java.sql.SQLException
Attempts to establish a connection with the data source that
this DataSource
object represents.
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
- if a database access error occurspublic java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
Attempts to establish a connection with the data source that
this DataSource
object represents.
getConnection
in interface javax.sql.DataSource
username
- the database user on whose behalf the connection is
being madepassword
- the user's password
java.sql.SQLException
- if a database access error occurspublic java.io.PrintWriter getLogWriter() throws java.sql.SQLException
Retrieves the log writer for this DataSource
object.
getLogWriter
in interface javax.sql.DataSource
java.sql.SQLException
- if a database access error occurspublic void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException
Sets the log writer for this DataSource
object to the given java.io.PrintWriter
object.
setLogWriter
in interface javax.sql.DataSource
out
- the new log writer; to disable logging, set to null
java.sql.SQLException
- if a database access error occurspublic void setLoginTimeout(int seconds) throws java.sql.SQLException
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.
setLoginTimeout
in interface javax.sql.DataSource
seconds
- the data source login time limit
java.sql.SQLException
- if a database access error occurs.public int getLoginTimeout() throws java.sql.SQLException
getLoginTimeout
in interface javax.sql.DataSource
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 |