com.ibm.as400.access
Class AS400JDBCXADataSource

java.lang.Object
  extended by com.ibm.as400.access.AS400JDBCDataSource
      extended by com.ibm.as400.access.AS400JDBCXADataSource
All Implemented Interfaces:
Serializable, Cloneable, Wrapper, Referenceable, CommonDataSource, DataSource, XADataSource

public class AS400JDBCXADataSource
extends AS400JDBCDataSource
implements XADataSource

The AS400JDBCXADataSource class represents a factory for AS400JDBCXAConnection objects.

This support is only available when connecting to systems running OS/400 V5R1 or later, or IBM i.

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

Field Summary
 
Fields inherited from class com.ibm.as400.access.AS400JDBCDataSource
CONCURRENTACCESS_NOT_SET, CONCURRENTACCESS_SKIP_LOCKS, CONCURRENTACCESS_USE_CURRENTLY_COMMITTED, CONCURRENTACCESS_WAIT_FOR_OUTCOME, MAX_STORAGE_LIMIT, 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(String serverName)
          Constructs an AS400JDBCXADataSource with the specified serverName.
AS400JDBCXADataSource(String serverName, String user, String password)
          Constructs an AS400JDBCXADataSource with the specified signon information.
AS400JDBCXADataSource(String serverName, String user, String password, String keyRingName, String keyRingPassword)
          Constructs an AS400JDBCXADataSource with the specified signon information to use for SSL communications with the IBM i system.
 
Method Summary
 Reference getReference()
          Returns the Reference object for the data source object.
 XAConnection getXAConnection()
          Returns an XA connection to IBM i.
 XAConnection getXAConnection(String user, String password)
          Returns an XA connection to IBM i.
 boolean isWrapperFor(Class<?> iface)
          Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.
<T> T
unwrap(Class<T> iface)
          Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.
 
Methods inherited from class com.ibm.as400.access.AS400JDBCDataSource
addPropertyChangeListener, clone, getAccess, getBehaviorOverride, getBidiStringType, getBlockCriteria, getBlockSize, getConcurrentAccessResolution, getConnection, getConnection, getCursorSensitivity, getDatabaseName, getDataSourceName, getDateFormat, getDateSeparator, getDecfloatRoundingMode, getDecimalSeparator, getDescription, getDriver, getErrors, getIgnoreWarnings, getKeepAlive, getLibraries, getLobThreshold, getLoginTimeout, getLogWriter, getMaximumBlockedInputRows, getMaximumPrecision, getMaximumScale, getMetadataSource, getMetaDataSource, getMinimumDivideScale, getNaming, getPackage, getPackageCcsid, getPackageCCSID, getPackageCriteria, getPackageError, getPackageLibrary, getProxyServer, getQaqqinilib, getQaqqiniLibrary, getQueryOptimizeGoal, getQueryStorageLimit, getReceiveBufferSize, getRemarks, getSecondaryUrl, getSecondaryURL, getSendBufferSize, getServerName, getServerTrace, getServerTraceCategories, getSocketTimeout, getSoLinger, getSort, getSortLanguage, getSortTable, getSortWeight, getSoTimeout, getTcpNoDelay, getTimeFormat, getTimeSeparator, getToolboxTrace, getToolboxTraceCategory, getTransactionIsolation, getTranslateHex, getUser, getValidWrappedList, getXALooselyCoupledSupport, isAutoCommit, isAutocommitException, isBidiImplicitReordering, isBidiNumericOrdering, isBigDecimal, isCursorHold, isDataCompression, isDataTruncation, isExtendedDynamic, isExtendedMetadata, isExtendedMetaData, isFullOpen, isHoldInputLocators, isHoldStatements, isJvm16Synchronize, isLazyClose, isPackageAdd, isPackageCache, isPackageClear, isPrefetch, isPrompt, isRollbackCursorHold, isSavePasswordWhenSerialized, isSecure, isSecureCurrentUser, isThreadUsed, isTrace, isTranslateBinary, isTranslateBoolean, isTrueAutocommit, isTrueAutoCommit, isUseBlockUpdate, isVariableFieldCompression, removePropertyChangeListener, setAccess, setAutoCommit, setAutocommitException, setBehaviorOverride, setBidiImplicitReordering, setBidiNumericOrdering, setBidiStringType, setBigDecimal, setBlockCriteria, setBlockSize, setConcurrentAccessResolution, setCursorHold, setCursorSensitivity, setDatabaseName, setDataCompression, setDataSourceName, setDataTruncation, setDateFormat, setDateSeparator, setDecfloatRoundingMode, setDecimalSeparator, setDescription, setDriver, setErrors, setExtendedDynamic, setExtendedMetadata, setExtendedMetaData, setFullOpen, setHoldInputLocators, setHoldStatements, setIgnoreWarnings, setJvm16Synchronize, setKeepAlive, setLazyClose, setLibraries, setLobThreshold, setLoginTimeout, setLogWriter, setMaximumBlockedInputRows, setMaximumPrecision, setMaximumScale, setMetadataSource, setMetaDataSource, setMinimumDivideScale, setNaming, setPackage, setPackageAdd, setPackageCache, setPackageCcsid, setPackageCCSID, setPackageClear, setPackageCriteria, setPackageError, setPackageLibrary, setPassword, setPrefetch, setPrompt, setProperties, setProperties, setProxyServer, setQaqqinilib, setQaqqiniLibrary, setQueryOptimizeGoal, setQueryStorageLimit, setReceiveBufferSize, setRemarks, setRollbackCursorHold, setSavePasswordWhenSerialized, setSecondaryUrl, setSecondaryURL, setSecure, setSecureCurrentUser, setSendBufferSize, setServerName, setServerTrace, setServerTraceCategories, setSocketTimeout, setSoLinger, setSort, setSortLanguage, setSortTable, setSortWeight, setSoTimeout, setTcpNoDelay, setThreadUsed, setTimeFormat, setTimeSeparator, setToolboxTrace, setToolboxTraceCategory, setTrace, setTransactionIsolation, setTranslateBinary, setTranslateBoolean, setTranslateHex, setTrueAutocommit, setTrueAutoCommit, setUseBlockUpdate, setUser, setVariableFieldCompression, setXALooselyCoupledSupport, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sql.CommonDataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Constructor Detail

AS400JDBCXADataSource

public AS400JDBCXADataSource()
Constructs a default AS400JDBCXADataSource object.


AS400JDBCXADataSource

public AS400JDBCXADataSource(String serverName)
Constructs an AS400JDBCXADataSource with the specified serverName.

Parameters:
serverName - The name of the IBM i system.

AS400JDBCXADataSource

public AS400JDBCXADataSource(String serverName,
                             String user,
                             String password)
Constructs an AS400JDBCXADataSource with the specified signon information.

Parameters:
serverName - The name of the IBM i system.
user - The user id.
password - The password.

AS400JDBCXADataSource

public AS400JDBCXADataSource(String serverName,
                             String user,
                             String password,
                             String keyRingName,
                             String keyRingPassword)
Constructs an AS400JDBCXADataSource with the specified signon information to use for SSL communications with the IBM i system.

Parameters:
serverName - The name of the IBM i system.
user - The user id.
password - The password.
keyRingName - The key ring class name to be used for SSL communications with the system.
keyRingPassword - The password for the key ring class to be used for SSL communications with the system.
Method Detail

getXAConnection

public XAConnection getXAConnection()
                             throws SQLException
Returns an XA connection to IBM i.

Specified by:
getXAConnection in interface XADataSource
Returns:
An XA connection.
Throws:
SQLException - If a database error occurs.

getXAConnection

public XAConnection getXAConnection(String user,
                                    String password)
                             throws SQLException
Returns an XA connection to IBM i.

Specified by:
getXAConnection in interface XADataSource
Parameters:
user - The userid for the connection.
password - The password for the connection.
Returns:
An XA connection.
Throws:
SQLException - If a database error occurs.

getReference

public Reference getReference()
                       throws 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.

Specified by:
getReference in interface Referenceable
Overrides:
getReference in class AS400JDBCDataSource
Returns:
A Reference object for the data source object.
Throws:
NamingException - If a naming error occurs resolving the object.

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
                     throws SQLException
Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively calling isWrapperFor on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared to unwrap so that callers can use this method to avoid expensive unwrap calls that may fail. If this method returns true then calling unwrap with the same argument should succeed.

Specified by:
isWrapperFor in interface Wrapper
Parameters:
iface - a Class defining an interface.
Returns:
true if this implements the interface or directly or indirectly wraps an object that does.
Throws:
SQLException - if an error occurs while determining whether this is a wrapper for an object with the given interface.

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise return the the result of calling unwrap recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then an SQLException is thrown.

Specified by:
unwrap in interface Wrapper
Parameters:
iface - A Class defining an interface that the result must implement.
Returns:
an object that implements the interface. May be a proxy for the actual implementing object.
Throws:
SQLException - If no object found that implements the interface