com.ibm.as400.access

Class 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
    • 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

      • 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.