com.ibm.as400.access
Class AS400JDBCXADataSource

java.lang.Object
  |
  +--com.ibm.as400.access.AS400JDBCDataSource
        |
        +--com.ibm.as400.access.AS400JDBCXADataSource
All Implemented Interfaces:
javax.sql.DataSource, javax.naming.Referenceable, java.io.Serializable, javax.sql.XADataSource

public class AS400JDBCXADataSource
extends AS400JDBCDataSource
implements javax.sql.XADataSource

The AS400JDBCXADataSource class represents a factory for AS400JDBCXAConnection objects.

This support is only available when connecting to servers running OS/400 V5R1 or later.

The following example creates an AS400JDBCXADataSource object and creates a connection to the database.

// Create an XA data source for making the connection. AS400JDBCXADataSource xaDataSource = new AS400JDBCXADataSource("myAS400"); xaDataSource.setUser("myUser"); xaDataSource.setPassword("myPasswd"); // Get the XAConnection. XAConnection xaConnection = xaDataSource.getXAConnection();

See Also:
AS400JDBCXAConnection, AS400JDBCXAResource, Serialized Form

Fields inherited from class com.ibm.as400.access.AS400JDBCDataSource
SERVER_TRACE_DEBUG_SERVER_JOB, SERVER_TRACE_SAVE_SERVER_JOBLOG, SERVER_TRACE_SAVE_SQL_INFORMATION, SERVER_TRACE_START_DATABASE_MONITOR, SERVER_TRACE_TRACE_SERVER_JOB
 
Constructor Summary
AS400JDBCXADataSource()
          Constructs a default AS400JDBCXADataSource object.
AS400JDBCXADataSource(java.lang.String serverName)
          Constructs an AS400JDBCXADataSource with the specified serverName.
AS400JDBCXADataSource(java.lang.String serverName, java.lang.String user, java.lang.String password)
          Constructs an AS400JDBCXADataSource with the specified signon information.
AS400JDBCXADataSource(java.lang.String serverName, java.lang.String user, java.lang.String password, java.lang.String keyRingName, java.lang.String keyRingPassword)
          Constructs an AS400JDBCXADataSource with the specified signon information to use for SSL communications with the server.
 
Method Summary
 javax.naming.Reference getReference()
          Returns the Reference object for the data source object.
 javax.sql.XAConnection getXAConnection()
          Returns an XA connection to the AS/400 or iSeries.
 javax.sql.XAConnection getXAConnection(java.lang.String user, java.lang.String password)
          Returns an XA connection to the AS/400 or iSeries.
 
Methods inherited from class com.ibm.as400.access.AS400JDBCDataSource
addPropertyChangeListener, getAccess, getBidiStringType, getBlockCriteria, getBlockSize, getConnection, getConnection, getDatabaseName, getDataSourceName, getDateFormat, getDateSeparator, getDecimalSeparator, getDescription, getDriver, getErrors, getLibraries, getLobThreshold, getLoginTimeout, getLogWriter, getNaming, getPackage, getPackageCriteria, getPackageError, getPackageLibrary, getProxyServer, getRemarks, getSecondaryUrl, getServerName, getServerTraceCategories, getSort, getSortLanguage, getSortTable, getSortWeight, getTimeFormat, getTimeSeparator, getTransactionIsolation, getUser, isBigDecimal, isCursorHold, isDataCompression, isDataTruncation, isExtendedDynamic, isExtendedMetaData, isFullOpen, isLazyClose, isPackageAdd, isPackageCache, isPackageClear, isPrefetch, isPrompt, isSavePasswordWhenSerialized, isSecure, isThreadUsed, isTrace, isTranslateBinary, removePropertyChangeListener, setAccess, setBidiStringType, setBigDecimal, setBlockCriteria, setBlockSize, setCursorHold, setDatabaseName, setDataCompression, setDataSourceName, setDataTruncation, setDateFormat, setDateSeparator, setDecimalSeparator, setDescription, setDriver, setErrors, setExtendedDynamic, setExtendedMetaData, setFullOpen, setLazyClose, setLibraries, setLobThreshold, setLoginTimeout, setLogWriter, setNaming, setPackage, setPackageAdd, setPackageCache, setPackageClear, setPackageCriteria, setPackageError, setPackageLibrary, setPassword, setPrefetch, setPrompt, setProxyServer, setRemarks, setSavePasswordWhenSerialized, setSecondaryUrl, setSecure, setServerName, setServerTraceCategories, setSort, setSortLanguage, setSortTable, setSortWeight, setThreadUsed, setTimeFormat, setTimeSeparator, setTrace, setTransactionIsolation, setTranslateBinary, setUser, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sql.XADataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 

Constructor Detail

AS400JDBCXADataSource

public AS400JDBCXADataSource()
Constructs a default AS400JDBCXADataSource object.

AS400JDBCXADataSource

public AS400JDBCXADataSource(java.lang.String serverName)
Constructs an AS400JDBCXADataSource with the specified serverName.
Parameters:
serverName - The name of the AS/400 or iSeries server.

AS400JDBCXADataSource

public AS400JDBCXADataSource(java.lang.String serverName,
                             java.lang.String user,
                             java.lang.String password)
Constructs an AS400JDBCXADataSource with the specified signon information.
Parameters:
serverName - The name of the AS/400 or iSeries server.
user - The user id.
password - The password.

AS400JDBCXADataSource

public AS400JDBCXADataSource(java.lang.String serverName,
                             java.lang.String user,
                             java.lang.String password,
                             java.lang.String keyRingName,
                             java.lang.String keyRingPassword)
Constructs an AS400JDBCXADataSource with the specified signon information to use for SSL communications with the server.
Parameters:
serverName - The name of the AS/400 or iSeries server.
user - The user id.
password - The password.
keyRingName - The key ring class name to be used for SSL communications with the server.
keyRingPassword - The password for the key ring class to be used for SSL communications with the server.
Method Detail

getXAConnection

public javax.sql.XAConnection getXAConnection()
                                       throws java.sql.SQLException
Returns an XA connection to the AS/400 or iSeries.
Specified by:
getXAConnection in interface javax.sql.XADataSource
Returns:
An XA connection.
Throws:
java.sql.SQLException - If a database error occurs.

getXAConnection

public javax.sql.XAConnection getXAConnection(java.lang.String user,
                                              java.lang.String password)
                                       throws java.sql.SQLException
Returns an XA connection to the AS/400 or iSeries.
Specified by:
getXAConnection in interface javax.sql.XADataSource
Parameters:
user - The userid for the connection.
password - The password for the connection.
Returns:
An XA connection.
Throws:
java.sql.SQLException - If a database error occurs.

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Returns the Reference object for the data source object. This is used by JNDI when bound in a JNDI naming service. Contains the information necessary to reconstruct the data source object when it is later retrieved from JNDI via an object factory.
Overrides:
getReference in class AS400JDBCDataSource
Returns:
A Reference object for the data source object.
Throws:
javax.naming.NamingException - If a naming error occurs resolving the object.