|
|
| Sun ONE Connector Builder 2.0 Installation and Getting Started Guide |
Deploying the DBMS Sample AdapterThis module describes how to deploy and run the DBMS sample adapter and application that is packaged with the Sun ONE Connector Builder.
The following topic is described:
The DBMS sample includes a resource adapter and sample test programs that use the DBMS resource adapter. The DBMS sample is located under the <connector_builder_install_root>/samples/dbms directory. Optionally you can refer to `DesigningTheDBMSAdapter.html' file available under <connector_builder_install_root>/samples/dbms/adapters directory to recreate this sample adapter.
Deploying, Configuring, and Running the DBMS Sample
The following are the steps to deploy, configure and run sample tests using the Sun ONE Connector Builder sample resource adapter DBMS:
- Step 1 - Deploy and Configure the DBMS Sample Resource Adapter
- Step 2- Configure the Database
- Step 3 - Verify the DBMS Resource Adapter Deployment
Oracle Client Requirements
The Oracle JDBC driver (available with Oracle installation) needs to be in the classpath of the deployed DBMS Adapter.
Step 1 - Deploy and Configure the DBMS Sample Resource Adapter
The DBMS resource adapter (DBMS.rar) can be deployed into:
- iPlanet Application Server 6.5
- iPlanet Web Server 6.0
- J2EE Reference Implementation Server 1.3.1
- Sun ONE Application Server 7.0
iPlanet Application Server 6.5
Use the icsvrreg, icradeploy, and icconfig command line tools to deploy the sample DBMS resource adapter into iPlanet Application Server 6.5. The command line tools are available under <connector_builder_install_root>/bin directory.
To Deploy the DBMS Resource Adapter into iPlanet Application Server 6.5
- Register the Server (if the server is not already registered)
Use the following command to register a deployment instance:
icsvrreg add -n <server_logical_name> -t ias65 -d <ias_install_directory>
Windows:
icsvrreg add -n ias65Server -t ias65 -d d:\iPlanet\ias65
Solaris:
icsvrreg add -n ias65Server -t ias65 -d /export/iplanet/ias65
- Deploy the Sample DBMS Resource Adapter (DBMS.rar)
Use the following command to deploy DBMS resource adapter:
icradeploy deploy -s <server_logical_name> -a <adapter_name> -r <rar_file>
Windows:
icradeploy deploy -s ias65Server -a DBMS -r <connector_builder_install_root>\samples\dbms\adapters\DBMS\ship\DBMS.rar
Solaris:
icradeploy deploy -s ias65Server -a DBMS -r <connector_builder_install_root>/samples/dbms/adapters/DBMS/ship/DBMS.rar
- Configure the Connection Factory with Lookup Name DBMS
Use the following command to configure a connection factory with default parameters:
(ConnectionURL: jdbc:oracle:thin:@localhost:1521:ORCL, JDBCDriver: oracle.jdbc.driver.OracleDriver, UserName: ICBUSER1, Password=ICBUSER1): icconfig add -s ias65Server -n DBMS -a DBMS
Use the -p option to set values other than the defaults for the connection factory.
Note You must restart the server for the changes to take effect.
iPlanet Web Server 6.0
Use icsvrreg, icradeploy, and icconfig command line tools to deploy sample adapter into iPlanet Web Server 6.0. The command line tools are available under <connector_builder_install_root>/bin directory.
By default, the iPlanet Web Server is installed with JRE 1.2.2. The iPlanet Web Server must be configured with JDK 1.3.1 to deploy resource adapters built using Sun ONE Connector Builder.
To Configure iPlanet Web Server for JDK 1.3.1
- Start the iPlanet Web Server Admin Server.
- Log into the iPlanet Web Server admin console. (http://<hostname>:<admin port> (default port: 8888).
- Click on the 'Global Settings' tab.
- Click on 'Configure JRE/JDK Paths' link (on the left of the screen).
- Select 'JDK' and enter the location of JDK (for example, /usr/jdk131). Additional information related to libpath and classpath does not need to be entered.
- Restart the web server.
To Deploy the DBMS Resource Adapter into iPlanet Web Server 6.0
- Register the Server (if the server is not already registered)
Use the following command to register a deployment instance:
icsvrreg add -n <server_logical_name> -t iws -d <iws_instance_directory>
Windows:
icsvrreg add -n iwsServer -t iws -d d:\iPlanet\Servers\https-<webserver_instance>
Solaris:
icsvrreg add -n iwsServer -t iws -d /export/iPlanet/Servers/https-<webserver_instance>
- Deploy the DBMS Sample Resource Adapter (DBMS.rar)
Use the following command to deploy DBMS resource adapter:
icradeploy deploy -s <server_logical_name> -a <adapter_name> -r <rar_file>
Windows:
icradeploy deploy -s iwsServer -a DBMS -r <connector_builder_install_root>\samples\dbms\adapters\DBMS\ship\ DBMS.rar
Solaris:
icradeploy deploy -s iwsServer -a DBMS -r <connector_builder_install_root>/samples/dbms/adapters/DBMS/ship/ DBMS.rar
- Configure the Connection Factory with Lookup Name DBMS
Use the following command to configure a connection factory with default parameters (ConnectionURL: jdbc:oracle:thin:@localhost:1521:ORCL, JDBCDriver: oracle.jdbc.driver.OracleDriver, UserName: ICBUSER1, Password: ICBUSER1):
icconfig add -s ias65Server -n DBMS -a DBMSUse the -p option to set values other than default for the connection factory.
Note You must restart the server for the changes to take effect.
J2EE Reference Implementation Server 1.3.1
To Deploy the DBMS Resource Adapter into J2EE RI Server 1.3.1
Use the 'J2EE RI Server -Deployment Tool' to deploy the sample resource adapter DBMS packaged as DBMS.rar file. The DBMS.rar file is located under <connector_builder_install_root>/samples/dbms/adapters/DBMS/ship/ DBMS.rar
Open the 'DBMS.rar' using 'File -> Open' option of RI Deployment Tool. Deploy the resource adapter using 'Tools -> Deploy' menu option. Add Connection Factory with lookup name DBMS using default parameters.
Refer to J2EE RI documentation for details on how to deploy and configure connection factories.
Note You must restart the server for the changes to take effect.
Sun ONE Application Server 7.0
Use the Sun ONE Application Server to deploy the sample resource adapter DBMS packaged as DBMS S.rar file. The DBMS.rar file is located under <connector_builder_install_root>/samples/dbms/adapters/DBMS/ship/DBMS.rar. For more information about deployment generated resource adapters see the Administrator's Guide for the Sun ONE Application Server 7.
Step 2- Configure the Database
An SQL script is provided for Oracle to create the necessary tables, stored procedures and sample data. The script ora_sql.txt is located in the <connector_builder_install_root>/samples/dbms/adapters/DBMS/test/ src directory.
To Run the Sample Tests Provided with the DBMS Resource Adapter
- Create a database user with name 'ICBUSER1' and password 'ICBUSER1'.
- Grant DBA permissions to 'ICBUSER1'.
- Start sqlplus using the ICBUSER1 user id to run the sql script, ora_sql.txt.
- Verify that the database is configured successfully by executing 'select * from EMP_LOOKUP' sql command using sqlplus. It should return the sample data.
Step 3 - Verify the DBMS Resource Adapter Deployment
Verify that the connection factory configuration parameters reflect your database setup. The default values are as follows:
- ConnectionURL: jdbc:oracle:thin:@localhost:1521:ORCL
- JDBCDriver: oracle.jdbc.driver.OracleDriver
- UserName: ICBUSER1
- Password: ICBUSER1
- If the Oracle Server is running on a different host, replace the ConnectionURL with the corresponding parameters.
To Verify the DBMS Sample Resource Adapter Deployment
- Use the icconfig command or platform specific tool to reconfigure the connection factory DBMS, if required so.
- Configure the JDBC driver. You must configure the Oracle Thin JDBC driver to use the resource adapter. Update your deployment platform classpath to include 'classes12.zip' (Oracle Thin JDBC driver).
- Deploy the Sun ONE Connector Builder Test Servlet Router (suntest.war). Refer to Testing the Generated Resource Adapter, in Chapter 9 of the Sun ONE Connector Builder Developer's Guide for more details.
- Update the configuration files present under <connector_builder_install_root>/samples/dbms/adapters/DBMS/test/config to reflect your environment
- Use the 'ictstclnt' command line tool (ictstclnt -i DBMStestrun.properties) to run the sample tests to verify the resource adapter is deployed successfully.