Install the XADataSource sample in the Java 2 Enterprise Manager (J2EE) version 1.2

  • Copy the driver archive into the directory $J2EE_HOME/lib/system.
  • Add the driver archive Opta.jar to the classpath of the J2EE. The classpath of the J2EE is set with the environment variable J2EE_CLASSPATH and not with CLASSPATH.
  • Add the following lines to your config file

    *** If you can't install the Resource Manager Proxy in the SQL Server then you can use com.inet.tds.XDataSource instead of com.inet.tds.DTCDataSource.

  • Replace YourDatabase with a database of your SQL Server (for example the default database master)
  • Replace YourSQLServerHost with the name of your SQL Server.
  • Compile the sample in the package sample.xa.
  • Start the J2EE (or restart).
  • In the file “system.err” you can find the following two lines if everything has been configured correctly:
    Binding DataSource, name = jdbc/TdsSample, url = jdbc/XATdsSample
    Binding DataSource, name = jdbc/XATdsSample, dataSource = 
    com.inet.tds.DTCDataSource@29327a91;{database=YourDatabase, host=localhost, sql7=true}
  • Start the deployment tool of the J2EE (for example with deploytool.bat).
  • Click on “New Application”
  • Enter “XASample.ear” and “XASample” in the dialog box. You can use another name, also.
  • Select XASample in the tree and click on “New Enterprise Bean”.
  • Add the class files XATds.class, XATdsEJB.class and XATdsHome.class to the Contents with package.
  • Edit the JAR Display Name to “XASampleJar”. You can also use another name. You see the following picture.
  • In the next step select the class and interfaces. You see the next picture:
  • In the next steps add the account information for the bean like:
  • Click finish. You see the following picture:
  • Deploy the Application over the menue item “Tools | Deploy Application”.
  • Select the checkbox “Return Client Jar”. You see the next picture:
  • In the next step enter the JNDI name “XATdsTest”. This is the name that the client calls. You can it find in the script
  • Now you can start the client with: java -cp .;XASampleClient.jar;j2ee.jar sample.xa.XATdsClient

© Copyright 1996 - 2021, i-net software; All Rights Reserved.