Top Fields Constructors Methods
com.mysql.cj.jdbc

public Class MysqlXADataSource

extends MysqlDataSource
implements XADataSource
Class Inheritance
All Implemented Interfaces
javax.sql.XADataSource, javax.sql.CommonDataSource
Imports
java.sql.Connection, .SQLException, javax.sql.XAConnection, com.mysql.cj.conf.PropertyKey

Field Summary

Modifier and TypeField and Description
pack-priv static final long
Inherited from com.mysql.cj.jdbc.MysqlDataSource:
databaseNamedescriptionencodingexplicitPortexplicitUrlhostNamelogWritermysqlDriverpasswordportprofileSQLStringurluser

Constructor Summary

AccessConstructor and Description
public
MysqlXADataSource()

Default no-arg constructor is required by specification.

Method Summary

Modifier and TypeMethod and Description
public XAConnection
getXAConnection()

Implements javax.sql.XADataSource.getXAConnection.

Attempts to establish a physical database connection that can be used in a distributed transaction.

public XAConnection
getXAConnection(String
the database user on whose behalf the connection is being made
u
,
String
the user's password
p
)

Implements javax.sql.XADataSource.getXAConnection.

Attempts to establish a physical database connection, using the given user name and password.

private XAConnection

Returns:

XAConnection
wrapConnection
(Connection
connection to wrap
conn
)

Wraps a connection as a 'fake' XAConnection

Inherited from com.mysql.cj.jdbc.MysqlDataSource:
exposeAsPropertiesgetBooleanRuntimePropertygetConnectiongetConnectiongetConnectiongetDatabaseNamegetDescriptiongetEnumRuntimePropertygetIntegerRuntimePropertygetLoginTimeoutgetLogWritergetLongRuntimePropertygetMemorySizeRuntimePropertygetParentLoggergetPasswordgetPortgetPortNumbergetReferencegetServerNamegetStringRuntimePropertygetURLgetUrlgetUserisWrapperForsetBooleanRuntimePropertysetDatabaseNamesetDescriptionsetEnumRuntimePropertysetIntegerRuntimePropertysetLoginTimeoutsetLogWritersetLongRuntimePropertysetMemorySizeRuntimePropertysetPasswordsetPortsetPortNumbersetPropertiesViaRefsetServerNamesetStringRuntimePropertysetURLsetUrlsetUserunwrap

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides com.mysql.cj.jdbc.MysqlDataSource.serialVersionUID.

Constructor Detail

MysqlXADataSourceback to summary
public MysqlXADataSource()

Default no-arg constructor is required by specification.

Method Detail

getXAConnectionback to summary
public XAConnection getXAConnection() throws SQLException

Implements javax.sql.XADataSource.getXAConnection.

Doc from javax.sql.XADataSource.getXAConnection.

Attempts to establish a physical database connection that can be used in a distributed transaction.

Returns:XAConnection

an XAConnection object, which represents a physical connection to a data source, that can be used in a distributed transaction

Annotations
@Override
Exceptions
SQLException:
if a database access error occurs
getXAConnectionback to summary
public XAConnection getXAConnection(String u, String p) throws SQLException

Implements javax.sql.XADataSource.getXAConnection.

Doc from javax.sql.XADataSource.getXAConnection.

Attempts to establish a physical database connection, using the given user name and password. The connection that is returned is one that can be used in a distributed transaction.

Parameters
u:String

the database user on whose behalf the connection is being made

p:String

the user's password

Returns:XAConnection

an XAConnection object, which represents a physical connection to a data source, that can be used in a distributed transaction

Annotations
@Override
Exceptions
SQLException:
if a database access error occurs
wrapConnectionback to summary
private XAConnection wrapConnection(Connection conn) throws SQLException

Wraps a connection as a 'fake' XAConnection

Parameters
conn:Connection

connection to wrap

Returns:XAConnection

XAConnection

Exceptions
SQLException:
if an error occurs