Apache Derby 10.10

org.apache.derby.jdbc
Class EmbeddedXADataSource

java.lang.Object
  extended by org.apache.derby.jdbc.EmbeddedBaseDataSource
      extended by org.apache.derby.jdbc.ReferenceableDataSource
          extended by org.apache.derby.jdbc.EmbeddedDataSource
              extended by org.apache.derby.jdbc.EmbeddedXADataSource
All Implemented Interfaces:
java.io.Serializable, javax.naming.Referenceable, javax.naming.spi.ObjectFactory, javax.sql.DataSource, javax.sql.XADataSource, org.apache.derby.jdbc.EmbeddedDataSourceInterface, org.apache.derby.jdbc.EmbeddedXADataSourceInterface

public class EmbeddedXADataSource
extends EmbeddedDataSource
implements org.apache.derby.jdbc.EmbeddedXADataSourceInterface

This datasource is suitable for an application using embedded Derby, running on full Java SE 5 or 6, corresponding to JDBC 3.0 and 4.0. If running on Java SE 7 or higher, consider a more capable data source.

EmbeddedXADataSource is an XADataSource implementation.

An XADataSource is a factory for XAConnection objects. It represents a RM in a DTP environment. An object that implements the XADataSource interface is typically registered with a JNDI service provider.

EmbeddedXADataSource automatically supports the correct JDBC specification version for the Java Virtual Machine's environment.

EmbeddedXADataSource object only works on a local database. There is no client/server support. An EmbeddedXADataSource object must live in the same jvm as the database.

EmbeddedXADataSource is serializable and referenceable.

See EmbeddedDataSource for DataSource properties.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.derby.jdbc.EmbeddedBaseDataSource
attributesAsPassword, connectionAttributes, createDatabase, databaseName, dataSourceName, description, driver, jdbcurl, loginTimeout, shutdownDatabase
 
Constructor Summary
EmbeddedXADataSource()
          no-arg constructor
 
Method Summary
 org.apache.derby.iapi.jdbc.ResourceAdapter getResourceAdapter()
           
 javax.sql.XAConnection getXAConnection()
          Attempt to establish a database connection.
 javax.sql.XAConnection getXAConnection(java.lang.String user, java.lang.String password)
          Attempt to establish a database connection with the given user name and password.
protected  void update()
           
 
Methods inherited from class org.apache.derby.jdbc.EmbeddedDataSource
getReference
 
Methods inherited from class org.apache.derby.jdbc.ReferenceableDataSource
getObjectInstance
 
Methods inherited from class org.apache.derby.jdbc.EmbeddedBaseDataSource
equals, getAttributesAsPassword, getConnection, getConnection, getConnectionAttributes, getCreateDatabase, getDatabaseName, getDataSourceName, getDescription, getLoginTimeout, getLogWriter, getPassword, getShortDatabaseName, getShutdownDatabase, getUser, isWrapperFor, setAttributesAsPassword, setConnectionAttributes, setCreateDatabase, setDatabaseName, setDataSourceName, setDescription, setLoginTimeout, setLogWriter, setPassword, setShutdownDatabase, setupResourceAdapter, setUser, unwrap
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.derby.jdbc.EmbeddedDataSourceInterface
getAttributesAsPassword, getConnectionAttributes, getCreateDatabase, getDatabaseName, getDataSourceName, getDescription, getPassword, getShutdownDatabase, getUser, setAttributesAsPassword, setConnectionAttributes, setCreateDatabase, setDatabaseName, setDataSourceName, setDescription, setPassword, setShutdownDatabase, setUser
 
Methods inherited from interface javax.sql.DataSource
getConnection, getConnection, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 
Methods inherited from interface javax.sql.XADataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 

Constructor Detail

EmbeddedXADataSource

public EmbeddedXADataSource()
no-arg constructor

Method Detail

getXAConnection

public final javax.sql.XAConnection getXAConnection()
                                             throws java.sql.SQLException
Attempt to establish a database connection.

Specified by:
getXAConnection in interface javax.sql.XADataSource
Returns:
a Connection to the database
Throws:
java.sql.SQLException - if a database-access error occurs.

getXAConnection

public final javax.sql.XAConnection getXAConnection(java.lang.String user,
                                                    java.lang.String password)
                                             throws java.sql.SQLException
Attempt to establish a database connection with the given user name and password.

Specified by:
getXAConnection in interface javax.sql.XADataSource
Parameters:
user - the database user on whose behalf the Connection is being made
password - the user's password
Returns:
a Connection to the database
Throws:
java.sql.SQLException - if a database-access error occurs.

update

protected void update()
Overrides:
update in class org.apache.derby.jdbc.EmbeddedBaseDataSource

getResourceAdapter

public org.apache.derby.iapi.jdbc.ResourceAdapter getResourceAdapter()
Specified by:
getResourceAdapter in interface org.apache.derby.jdbc.EmbeddedXADataSourceInterface
Returns:
The ResourceAdapter instance for the underlying database

Built on Wed 2013-06-12 15:21:56+0000, from revision ???

Apache Derby 10.10 API Documentation - Copyright © 2004,2013 The Apache Software Foundation. All Rights Reserved.