StarQuest Technical Documents
Using StarSQL for Java with IBM's Websphere Application Server
Last Update: 3 October 2008
Product: StarSQL for Java
Version: 2.2 or later
Article ID: SQV00SJ005
Abstract
The StarSQL for Java JDBC driver can be used with IBM's Websphere Application Server (WAS) to access DB2 data. This document explains how to configure WAS versions 5 and 6 to use StarSQL for Java and how to create a JDBC data source.
Solution
Perform the steps in the section that applies to your version of the Websphere Application Server.
Websphere Application Server Version 5
Websphere Application Server Version 6.0
Websphere Application Server Version 6.1
Websphere Application Server Version 5
- Launch the Websphere Administrative Console.
- On the left pane, expand the Resource node and click on JDBC Providers.
- Click the New button to add a new provider.
- Select User-defined JDBC Provider from the JDBC Providers drop down list and click OK.
- On the Provider General Properties panel, configure the following properties:
Name Provide a descriptive name for the provider, such as "StarSQL for Java." Description Provide an optional description for the provider. Classpath Provide the path to the location of the StarSQL_JDBC.jar and StarLicense.properties files, such as C:\Program Files\StarQuest\StarSQL_Java\StarSQL_JDBC.jar; C:\Program Files\StarQuest\StarSQL_Java\StarLicense.properties. Implementation Classname Specify the class name depending on the type of application. Most Websphere applications will use the classname com.starsql.datasource.SQConnectionPoolDataSource. If your application requires transaction support, use the classname com.starsql.datasource.SQXADataSource
- Click OK and verify that the new StarSQL for Java provider is displayed in the JDBC Providers list.
- Click on the StarSQL for Java provider, select Data Sources and click the New button.
- On the Data Source General Properties panel, configure the following properties:
Name Provide a descriptive name for the data source, such as "DB2 Production." JNDI Name Specify a simple name for the data source that will be used by the calling application, such as "DB2Prod." Datasource Helper Classname Configure this property to use the classname com.ibm.websphere.rsadapter.GenericDataStoreHelper
Configure the other general properties as desired.
- Click Custom Properties and add the required data source properties for StarSQL for Java:
databaseName (type java.lang.String) Specify the name of the database to which you want to connect. portNumber (type java.lang.Integer) Specify the port number that the DB2 server is listening on for DRDA communications. The default DRDA port is 446. serverName (type java.lang.String) Specify the host name or IP address of the host as it is defined in the network. If the application requires transaction support, add the enable2Phase property (type java.lang.Boolean) and set this value to true. Refer to the StarSQL for Java User's Guide for information regarding the optional properties.
- Save the changes to the master configuration.
Websphere Application Server Version 6.0
- Launch the Websphere Administrative Console.
- On the left pane, expand the Resource node and click on JDBC Providers.
- Click the New button and configure the Provider as follows:
Database type User-defined. Provider type User-defined JDBC provider. Implementation type User-defined.
- Click the Next button and configure the following properties:
Name Provide a descriptive name for the provider, such as "StarSQL for Java." Description Provide an optional description for the provider. Classpath Provide the path to the location of the StarSQL_JDBC.jar and StarLicense.properties files, such as C:\Program Files\StarQuest\StarSQL_Java\StarSQL_JDBC.jar; C:\Program Files\StarQuest\StarSQL_Java\StarLicense.properties. Implementation Class name Specify the class name depending on the type of application. Most Websphere applications should use the classname com.starsql.datasource.SQConnectionPoolDataSource. If your application requires transaction support, use the classname com.starsql.datasource.SQXADataSource.
- Click OK and verify that the new StarSQL for Java provider is displayed in the JDBC Providers list.
- Click on the StarSQL for Java provider, select Data Sources and click the New button.
- On the Data Source General Properties, configure the following properties:
Name Provide a descriptive name for the data source, such as "DB2 Production." JNDI Name Specify a simple name for the data source that will be used by the calling application, such as "DB2Prod." Datasource Helper Classname Configure this property to use the classname com.ibm.websphere.rsadapter.GenericDataStoreHelper.
Configure the other properties as desired and click OK.
- Under the Additional Properties section, select Custom Properties.
databaseName (type java.lang.String) Specify the name of the database to which you want to connect. portNumber (type java.lang.Integer Specify the port number that the DB2 server is listening on for DRDA communications. The default DRDA port is 446. serverName (type java.lang.String) Specify the host name or IP address of the host as it is defined in the network.
If the application requires transaction support, add the enable2Phase property (type java.lang.Boolean) and set this value to true. Refer to the StarSQL for Java User's Guide for information regarding the optional properties.
- After setting all the required and optional properties, return to the General Properties by clicking on the data source link at the top of the page.
- Save the changes to the master configuration.
Websphere Application Server Version 6.1
- Launch the Websphere Administrative Console.
- On the left pane, expand the Resource node, expand JDBC and click on JDBC Providers.
- Click the New button and configure the Provider as follows:
Database type User-defined Implementation class name Specify the class name appropriate for the type of application. Most Websphere applications should use the classname com.starsql.datasource.SQConnectionPoolDataSource. If your application requires transaction support, use the classname com.starsql.datasource.SQXADataSource. Name Specify "StarSQL for Java." Description Provide an optional description for the provider.
- Click the Next button and configure the Classpath. The Classpath specifies the location of the StarSQL_JDBC.jar and StarLicense.properties files, such as C:\Program Files\StarQuest\StarSQL_Java\StarSQL_JDBC.jar; C:\Program Files\StarQuest\StarSQL_Java\StarLicense.properties.
- Click Next, and then Finish. Verify that the new StarSQL for Java provider is displayed in the JDBC Providers list.
- Click on the StarSQL for Java provider, select Data Sources and click the New button.
- On the basic data source information panel, configure the following properties:
Data source Name Provide a descriptive name for the data source, such as "DB2 Production." JNDI Name Specify a simple name for the data source that will be used by the calling application, such as "DB2Prod."
Configure the other properties as desired and click Next.
- Set the Data store helper class name to com.ibm.websphere.rsadapter.GenericDataStoreHelper, click Next, and then click Finish.
- Click on the data source and select Custom Properties. Add the data source properties:
databaseName (type java.lang.String) Specify the name of the database to which you want to connect. portNumber (type java.lang.Integer Specify the port number that the DB2 server is listening on for DRDA communications. The default DRDA port is 446 serverName (type java.lang.String) Specify the host name or IP address of the host as it is defined in the network. If the application requires transaction support, add the enable2Phase property (type java.lang.Boolean) and set this value to true. Refer to the StarSQL for Java User's Guide for information regarding the optional properties.
To verify connectivity using the Test Connection button you must add the user and password properties to the data source configuration. For the user (type java.lang.String) specify the user ID to use for logging on to the host database, and specify a valid password for the user account that is accessing the host database for the password (type java.lang.String). You can remove the user and password properties after connectivity has been verified.
- After setting the required and optional properties, return to the General Properties by clicking the data source link at the top of the page.
- Save the changes to the master configuration.
DISCLAIMER
The information in technical documents comes without any warranty or applicability for a specific purpose. The author(s) or distributor(s) will not accept responsibility for any damage incurred directly or indirectly through use of the information contained in these documents. The instructions may need to be modified to be appropriate for the hardware and software that has been installed and configured within a particular organization. The information in technical documents should be considered only as an example and may include information from various sources, including IBM, Microsoft, and other organizations.