|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A factory for XAConnection
objects that is used internally.
An object that implements the XADataSource
interface is
typically registered with a naming service that uses the
Java Naming and Directory InterfaceTM
(JNDI).
Method Summary | |
int |
getLoginTimeout()
Retrieves the maximum time in seconds that this data source can wait while attempting to connect to a data source. |
PrintWriter |
getLogWriter()
Retrieves the log writer for this XADataSource object. |
XAConnection |
getXAConnection()
Attempts to establish a physical database connection that can be used in a distributed transaction. |
XAConnection |
getXAConnection(String user,
String password)
Attempts to establish a physical database connection, using the given user name and password. |
void |
setLoginTimeout(int seconds)
Sets the maximum time in seconds that this data source will wait while attempting to connect to a data source. |
void |
setLogWriter(PrintWriter out)
Sets the log writer for this XADataSource object
to the given java.io.PrintWriter object.
|
Method Detail |
public XAConnection getXAConnection() throws SQLException
XAConnection
object, which represents a
physical connection to a data source, that can be used in
a distributed transaction
SQLException
- if a database access error occurspublic XAConnection getXAConnection(String user, String password) throws SQLException
user
- the database user on whose behalf the connection is being madepassword
- the user's password
XAConnection
object, which represents a
physical connection to a data source, that can be used in
a distributed transaction
SQLException
- if a database access error occurspublic PrintWriter getLogWriter() throws SQLException
Retrieves the log writer for this XADataSource
object.
null
if no log
writer has been set, which means that logging is disabled
SQLException
- if a database access error occurssetLogWriter(java.io.PrintWriter)
public void setLogWriter(PrintWriter out) throws SQLException
XADataSource
object
to the given java.io.PrintWriter
object.
The log writer is a character output stream to which all logging
and tracing messages for this XADataSource
object will be
printed. This includes messages printed by the methods of this
object, messages printed by methods of other objects manufactured
by this object, and so on. Messages printed to a log writer that is
specific to a data source are not printed to the log writer associated
with the java.sql.DriverManager
class. When a data source
object is created, the log writer is initially null
.
out
- the new log writer; to disable logging, set to null
SQLException
- if a database access error occursgetLogWriter()
public void setLoginTimeout(int seconds) throws SQLException
Sets the maximum time in seconds that this data source will wait while attempting to connect to a data source. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise, it specifies that there is no timeout. When a data source object is created, the login timeout is initially zero.
seconds
- the data source login time limit
SQLException
- if a database access error occursgetLoginTimeout()
public int getLoginTimeout() throws SQLException
XADataSource
object or zero if there is no
no timeout limit or the timeout limit is the default system
timeout limit if there is one
SQLException
- if a database access error occurssetLoginTimeout(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |