|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DataSource
An interface for the creation of Connection objects which represent a
connection to a database. This interface is an alternative to the
java.sql.DriverManager.
A class which implements the DataSource interface is typically registered with a JNDI naming service directory and is retrieved from there by name.
The DataSource interface is typically implemented by the writer of a JDBC driver. There are three variants of the DataSource interface, which produce Connections with differing characteristics:
Note that a JDBC driver which is accessed via the DataSource interface is
loaded via a JNDI lookup process. A driver loaded in this way does not
register itself with the DriverManager.
| Method Summary | |
|---|---|
Connection |
getConnection()
Creates a connection to the database represented by this DataSource. |
Connection |
getConnection(String theUsername,
String thePassword)
Creates a connection to the database represented by this DataSource, using a supplied Username and Password,. |
int |
getLoginTimeout()
Gets the Login Timeout value for this DataSource. |
PrintWriter |
getLogWriter()
Gets the Log Writer for this DataSource. |
void |
setLoginTimeout(int theTimeout)
Sets the Login Timeout value for this DataSource. |
void |
setLogWriter(PrintWriter theWriter)
Sets the Log Writer for this DataSource. |
| Method Detail |
|---|
Connection getConnection()
throws SQLException
SQLException - if there is a problem accessing the database.
Connection getConnection(String theUsername,
String thePassword)
throws SQLException
theUsername - a String containing a User Name for the databasethePassword - a String containing the Password for the user identified by
theUsername
SQLException - if there is a problem accessing the database.
int getLoginTimeout()
throws SQLException
SQLException - if there is a problem accessing the database.
PrintWriter getLogWriter()
throws SQLException
The Log Writer is a stream to which all log and trace messages are sent
from this DataSource. The Log Writer can be null, in which case, log and
trace capture is disabled. The default value for the Log Writer when an
DataSource is created is null. Note that the Log Writer for an DataSource
is not the same as the Log Writer used by a DriverManager.
SQLException - if there is a problem accessing the database.
void setLoginTimeout(int theTimeout)
throws SQLException
theTimeout - the new Login Timeout value in seconds.
SQLException - if there is a problem accessing the database.
void setLogWriter(PrintWriter theWriter)
throws SQLException
The Log Writer is a stream to which all log and trace messages are sent
from this DataSource. The Log Writer can be null, in which case, log and
trace capture is disabled. The default value for the Log Writer when an
DataSource is created is null. Note that the Log Writer for an DataSource
is not the same as the Log Writer used by a DriverManager.
theWriter - a PrintWriter to use as the Log Writer for this DataSource.
SQLException - if there is a problem accessing the database.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||