public interface XADataSource extends CommonDataSource
XAConnection对象内部使用厂。实现
XADataSource接口通常是一个命名服务,使用java命名和目录接口™注册一个对象(JNDI)。
XADataSource的实施必须包括一个公共的无参数构造函数。
| Modifier and Type | Method and Description |
|---|---|
XAConnection |
getXAConnection()
试图建立一个可以在分布式事务中使用的物理数据库连接。
|
XAConnection |
getXAConnection(String user, String password)
试图建立一个物理数据库连接,使用给定的用户名和密码。
|
getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriterXAConnection getXAConnection() throws SQLException
XAConnection对象,它表示对数据源的物理连接,可用于分布式事务
SQLException -如果一个数据库访问错误发生
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
SQLTimeoutException -当司机已确定由
setLoginTimeout方法指定超时值已经超过,至少试图取消当前的数据库连接的尝试
XAConnection getXAConnection(String user, String password) throws SQLException
user -数据库用户的连接是其代表
password -用户的密码
XAConnection对象,它表示对数据源的物理连接,可用于分布式事务
SQLException -如果一个数据库访问错误发生
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
SQLTimeoutException -当司机已确定由
setLoginTimeout方法指定超时值已经超过,至少试图取消当前的数据库连接的尝试
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.