Top Description Fields Constructors Methods
org.apache.derby.jdbc

public Class BasicEmbeddedXADataSource40

extends BasicEmbeddedDataSource40
implements EmbeddedXADataSourceInterface, XADataSource
Class Inheritance
All Implemented Interfaces
javax.sql.XADataSource, javax.sql.CommonDataSource, org.apache.derby.iapi.jdbc.EmbeddedXADataSourceInterface, org.apache.derby.iapi.jdbc.EmbeddedDataSourceInterface, javax.sql.DataSource, java.sql.Wrapper
Imports
java.sql.SQLException, javax.sql.XAConnection, org.apache.derby.iapi.jdbc.EmbeddedXADataSourceInterface, .ResourceAdapter, org.apache.derby.impl.jdbc.EmbedXAConnection

This data source is suitable for an application using embedded Derby, running on Java 8 Compact Profile 2 or higher.

BasicEmbeddedXADataSource40 is similar to EmbeddedXADataSource40, except that it does not support JNDI naming, i.e. it does not implement javax.naming.Referenceable.

See Also
EmbeddedXADataSource40

Field Summary

Modifier and TypeField and Description
private transient ResourceAdapter
ra

link to the database

private static final long
Inherited from org.apache.derby.jdbc.BasicEmbeddedDataSource40:
attributesAsPasswordconnectionAttributescreateDatabasedatabaseNamedataSourceNamedescriptiondriverjdbcurlloginTimeoutshutdownDatabase

Constructor Summary

AccessConstructor and Description
public
BasicEmbeddedXADataSource40()

Constructs a basic embedded XA data source.

Method Summary

Modifier and TypeMethod and Description
private XAConnection

Returns:

An XA connection to the database
createXAConnection
(ResourceAdapter
The resource adapter for this database
ra
,
String
The user name
user
,
String
The password
password
,
boolean
@false if original call is from a no-argument constructor, otherwise true
requestPassword
)

Instantiate and return an EmbedXAConnection from this instance of EmbeddedXADataSource.

public ResourceAdapter

Returns:

The ResourceAdapter instance for the underlying database
getResourceAdapter
()

Implements org.apache.derby.iapi.jdbc.EmbeddedXADataSourceInterface.getResourceAdapter.

public final XAConnection
getXAConnection()

Implements javax.sql.XADataSource.getXAConnection.

Attempts to establish a physical database connection that can be used in a distributed transaction.
public final XAConnection
getXAConnection(String
the database user on whose behalf the connection is being made
user
,
String
the user's password
password
)

Implements javax.sql.XADataSource.getXAConnection.

Attempts to establish a physical database connection, using the given user name and password.
protected void
Inherited from org.apache.derby.jdbc.BasicEmbeddedDataSource40:
equalsfindDrivergetAttributesAsPasswordgetConnectiongetConnectiongetConnectiongetConnectionAttributesgetCreateDatabasegetDatabaseNamegetDataSourceNamegetDescriptiongetLoginTimeoutgetLogWritergetParentLoggergetPasswordgetShutdownDatabasegetUserhashCodeisWrapperForsetAttributesAsPasswordsetConnectionAttributessetCreateDatabasesetDatabaseNamesetDataSourceNamesetDescriptionsetLoginTimeoutsetLogWritersetPasswordsetShutdownDatabasesetupResourceAdaptersetUserunwrap

Field Detail

raback to summary
private transient ResourceAdapter ra

link to the database

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.derby.jdbc.BasicEmbeddedDataSource40.serialVersionUID.

Constructor Detail

BasicEmbeddedXADataSource40back to summary
public BasicEmbeddedXADataSource40()

Constructs a basic embedded XA data source. See the class Javadoc.

Method Detail

createXAConnectionback to summary
private XAConnection createXAConnection(ResourceAdapter ra, String user, String password, boolean requestPassword) throws SQLException

Instantiate and return an EmbedXAConnection from this instance of EmbeddedXADataSource. Minion method.

Parameters
ra:ResourceAdapter

The resource adapter for this database

user:String

The user name

password:String

The password

requestPassword:boolean

@false if original call is from a no-argument constructor, otherwise true

Returns:XAConnection

An XA connection to the database

getResourceAdapterback to summary
public ResourceAdapter getResourceAdapter()

Implements org.apache.derby.iapi.jdbc.EmbeddedXADataSourceInterface.getResourceAdapter.

Returns:ResourceAdapter

The ResourceAdapter instance for the underlying database

Annotations
@Override
getXAConnectionback to summary
public final 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 final XAConnection getXAConnection(String user, String password) 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
user:String

the database user on whose behalf the connection is being made

password: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
updateback to summary
protected void update()

Overrides org.apache.derby.jdbc.BasicEmbeddedDataSource40.update.

Doc from org.apache.derby.jdbc.BasicEmbeddedDataSource40.update.

Update jdbcurl from attributes set.

Also clears ra.

Annotations
@Override