Interface XADataSource

public interface XADataSource 

The XADataSource is normally registered with a naming service using JNDI. It is used to access XAConnection objects.

Methods

getLoginTimeout

public int getLoginTimeout() throws java.sql.SQLException

This method enables you to get the time-out value for the connections. The time-out is the maximum time a connection will wait before determining that the connection cannot be established and throwing a SQLException is thrown if a database access error occurs.

Returns: The maximum amount of time for the login to succeed, in seconds

getLogWriter

public java.io.PrintWriter getLogWriter() throws java.sql.SQLException

This gets a character output stream to which all logging and tracing data is currently written. Logging is null by default, until the log writer is set for the first time. A SQLException is thrown if a database access error occurs.

Returns: The character output stream for the log writer for the data source or null if none is available

getXAConnection

public XAConnection getXAConnection() throws java.sql.SQLException

This establishes a database connection that must participate in distributed transactions using the default login and password for the current data source. You can use the getXAConnection(String user, String password) method to use another user/password pair for the connection. A SQLException is thrown if a database access error occurs.

Returns: A connection to the database

getXAConnection

public XAConnection getXAConnection(String user, String password) throws java.sql.SQLException 

This establishes a database connection that must participate in distributed transactions using the login and password provided. A SQLException is thrown if a database access error occurs.

Parameters:

user:

The database user for the connection

password:

The password

Returns: A connection to the database

setLoginTimeout

public void setLoginTimeout(int seconds) throws java.sql.SQLException

This method enables you to specify a time-out value for the connections. The time-out is the maximum time a connection will wait before determining that the connection cannot be established and throwing a SQLException is thrown if a database access error occurs.

Parameters:

seconds:

The maximum amount of time for the login to succeed, in seconds

setLogWriter

public void setLogWriter(java.io.PrintWriter out) throws java.sql.SQLException

This sets a character output stream to which all logging and tracing data will be written. Logging is null by default, until the log writer is set using this method. A SQLException is thrown if a database access error occurs.

Parameters:

out:

The character output stream used for the log writer of the data source or null if none is available, which disables logging



JDBC 3. 0. JAVA Database Connectivity
JDBC 3: Java Database Connectivity
ISBN: 0764548751
EAN: 2147483647
Year: 2002
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net