Setting up a server to test data sources for WebSphere Application Server v5.x
If you want to test data sources on a WebSphere Application Server v5.x, you may need to do one of the following steps:
Prerequisite: Create a WebSphere Application Server v5.x.
- In the Servers view, double-click the WebSphere Application Server v5.x. The server editor opens.
- Select the Data source tab at the bottom of the editor.
- To test data sources at the node level, expand Node Settings. To test data sources at the server level, expand Server Settings.
- A JDBC provider for DB2 and for Cloudscape will already be created for you (in the Server Settings section only). In that case, you may skip to step 6 if the predefined JDBC provider satisfies your requirements. Before using the predefined JDBC provider, verify that the Class path field specified in the Modify a JDBC Provider wizard is the correct class path that contains the database driver. You can complete this by selecting the JDBC provider from the JDBC provider list and click Edit to view or edit the JDBC class path.
- Create a JDBC provider. A JDBC provider contains configuration for software that enables Java applications to connect to JDBC-compliant databases.
- Beside the JDBC provider list table, click Add . The Create a JDBC Provider wizard opens.
- In the Database type list box, select a database type.
- In the JDBC provider type list box, select a JDBC provider and click Next.
Table 1. Examples of different JDBC providers JDBC Driver Types Example of resource provider IBM DB2 DB2 JDBC Provider Oracle Oracle JDBC Thin Driver Sybase Sybase 12.0 JDBC Driver - In the Name field, type the name of the resource provider.
- In the Implementation class name list, select or type the Java class name of the JDBC provider implementation.
Table 2. Examples of different Java class names of the JDBC provider implementation JDBC Provider Types Example of Java class name DB2 COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource Oracle oracle.jdbc.pool.OracleConnectionPoolDataSource Sybase com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource - In the Class path list box, if a driver path does not appear, click the Add Path or the Add External JARs button (you do not need to specify a class path if you are using Cloudscape). Type or browse to the path where JAR files containing driver classes are located. Ensure that the class path for the JDBC driver is specified correctly for the installation of DB2 on the machine where you are running WebSphere Application Server.
Table 3. Examples of different JAR files containing driver classes JDBC Driver Types Example of JAR files containing driver classes DB2 c:/Program Files/IBM/SQLLIB/java/db2java.zip Oracle c:/Oracle/Oracle9i/classes12.zip Sybase c:\jdbc\Sybase\classes\jconn2.jar Note:
The default DB2 JDBC provider class path on Linux is set to ${DB2_JDBC_DRIVER_PATH}/db2java.zip. The DB2 installation location cannot be detected on Linux. You must manually remove this class path entry and add a new entry with the correct path in the server editor if you want to use a DB2 data source on Linux.
- In the Native path list box, specify a list of paths that forms the location for the resource provider native libraries. Native path entries are separated by using the ENTER key and must not contain path separator characters (such as ';' or ':'). Native paths can contain variable (symbolic) names which you can substitute using a variable map.
- Click Finish.
- Define a data source and resource properties. Beside Data sources defined in the JDBC provider selected above list, click Add.
- The Create a Data Source wizard opens.
- Select the type of JDBC provider, for example DB2 JDBC Provider.
- Specify a data source for WebSphere Application Server version 5.0 or version 4.0. Click Next.
Note: Due to a limitation in the WebSphere Application Server, the Universal Test Client can only view version data sources for WebSphere Application Server version 4.0. Although data sources for WebSphere Application Server version 5.0 are still visible in the JNDI Explorer, you will not be able to view their details.
- On the Modify Data source page, specify the details of the data source that you want to create. For more information about any of the fields on this wizard, select the field and then press F1. Click Next.
- On the Create Resource properties page, select the resource property you want to modify, for example databasename.
- In the Value field, type the value for this property, for example, sample for the database name.
Table 4. Examples of different resource properties databaseName Value DB2 database_name Oracle database_name Cloudscape D:\temp\cloudscape\ database_name - Save and close the server editor.
Note: For Oracle, define the URL resource property with the value jdbc:oracle:thin:@ server_name :1521: database_name.