Databases Reference
In-Depth Information
b. hm: This variable is of type HashMap. The key for the HashMap is product
name and value is the quantity ordered .
3. Start the DB2 server.
4. Create the SAMPLE database using this command:
db2sampl -xml
5. Register the procedure created in “Stored procedure support” on page 219 to
the database.
6. Compile the Java code using the Java compiler.
7. Run the application.
5.13.2 Running the application as a Web service
To run the application as a Web service, follow these steps:
1. Install the Tomcat application server. You can obtain Tomcat from the
following Web site:
http://tomcat.apache.org/download-55.cgi
2. Install the Eclipse SDK.
3. Install the Tomcat-eclipse plug-in.
4. Download the application code from the IBM Redbooks Web site. For
download instructions, refer to Appendix C, “Additional material” on page 319.
5. Open the project in eclipse.
6. Start the DB2 server.
7. Create the SAMPLE database using the command:
db2sampl -xml
8. Register the procedure created in “Stored procedure support” on page 219 to
the sample database.
9. Start the Tomcat server.
10.Point your browser to this link:
http://localhost:8080/cart/default.jsp
If Tomcat and the application are downloaded onto a remote machine, give the
machine IP address/name instead of localhost.
Note: The previous project can be run using any application server. We
recommend Tomcat and Eclipse, because we used them to create the
application.
 
 
Search WWH ::




Custom Search