26 package javax.sql; |
26 package javax.sql; |
27 |
27 |
28 import java.sql.*; |
28 import java.sql.*; |
29 |
29 |
30 /** |
30 /** |
31 * A factory for <code>XAConnection</code> objects that is used internally. |
31 * A factory for {@code XAConnection} objects that is used internally. |
32 * An object that implements the <code>XADataSource</code> interface is |
32 * An object that implements the {@code XADataSource} interface is |
33 * typically registered with a naming service that uses the |
33 * typically registered with a naming service that uses the |
34 * Java Naming and Directory Interface<sup><font size=-3>TM</font></sup> |
34 * Java Naming and Directory Interface<sup><font size=-3>TM</font></sup> |
35 * (JNDI). |
35 * (JNDI). |
36 * |
36 * <p> |
|
37 * An implementation of {@code XADataSource} must include a public no-arg |
|
38 * constructor. |
37 * @since 1.4 |
39 * @since 1.4 |
38 */ |
40 */ |
39 |
41 |
40 public interface XADataSource extends CommonDataSource { |
42 public interface XADataSource extends CommonDataSource { |
41 |
43 |
42 /** |
44 /** |
43 * Attempts to establish a physical database connection that can be |
45 * Attempts to establish a physical database connection that can be |
44 * used in a distributed transaction. |
46 * used in a distributed transaction. |
45 * |
47 * |
46 * @return an <code>XAConnection</code> object, which represents a |
48 * @return an {@code XAConnection} object, which represents a |
47 * physical connection to a data source, that can be used in |
49 * physical connection to a data source, that can be used in |
48 * a distributed transaction |
50 * a distributed transaction |
49 * @exception SQLException if a database access error occurs |
51 * @exception SQLException if a database access error occurs |
50 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support |
52 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support |
51 * this method |
53 * this method |
|
54 * @throws SQLTimeoutException when the driver has determined that the |
|
55 * timeout value specified by the {@code setLoginTimeout} method |
|
56 * has been exceeded and has at least tried to cancel the |
|
57 * current database connection attempt |
52 * @since 1.4 |
58 * @since 1.4 |
53 */ |
59 */ |
54 XAConnection getXAConnection() throws SQLException; |
60 XAConnection getXAConnection() throws SQLException; |
55 |
61 |
56 /** |
62 /** |
58 * user name and password. The connection that is returned is one that |
64 * user name and password. The connection that is returned is one that |
59 * can be used in a distributed transaction. |
65 * can be used in a distributed transaction. |
60 * |
66 * |
61 * @param user the database user on whose behalf the connection is being made |
67 * @param user the database user on whose behalf the connection is being made |
62 * @param password the user's password |
68 * @param password the user's password |
63 * @return an <code>XAConnection</code> object, which represents a |
69 * @return an {@code XAConnection} object, which represents a |
64 * physical connection to a data source, that can be used in |
70 * physical connection to a data source, that can be used in |
65 * a distributed transaction |
71 * a distributed transaction |
66 * @exception SQLException if a database access error occurs |
72 * @exception SQLException if a database access error occurs |
67 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support |
73 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support |
68 * this method |
74 * this method |
|
75 * @throws SQLTimeoutException when the driver has determined that the |
|
76 * timeout value specified by the {@code setLoginTimeout} method |
|
77 * has been exceeded and has at least tried to cancel the |
|
78 * current database connection attempt |
69 * @since 1.4 |
79 * @since 1.4 |
70 */ |
80 */ |
71 XAConnection getXAConnection(String user, String password) |
81 XAConnection getXAConnection(String user, String password) |
72 throws SQLException; |
82 throws SQLException; |
73 } |
83 } |