CustomerDBClient.jws Sample

A sample that demonstrates use of a database control by managing customer records. CustomerDBClient is a client of CustomerDBControl.ctrl. Together they demonstrate construction of a Database control and use of a Database control by a web service. CustomerDBControl.ctrl demonstrates use of SQL's CREATE, DROP, INSERT, UPDATE, and SELECT statements.

# Concepts Demonstrated by this Sample

- Use of a Database control

# Location of Sample Files

This sample is located in the database folder of the samples WebLogic Workshop project. In the file system the location is:

BEA_HOME\weblogic700\samples\workshop\applications\database\CustomerDBClient.jws

# How to Run the Sample

To run this web service:

1. Start WebLogic Server in the appropriate domain.

   - On Microsoft Windows systems, from the Start menu navigate to:

   BEA WebLogic Platform 7.0->WebLogic Workshop->WebLogic Workshop Examples->Start Examples Server.

   - On Linux or Solaris systems, run:

   BEA_HOME/weblogic700/samples/workshop/startWebLogic.sh

2. Launch the service either by opening it in WebLogic Workshop and selecting the Start operation or by entering http://localhost:7001/samples/database/CustomerDBClient.jws in the address bar of your browser. If WebLogic Server is running in the appropriate domain on this machine, you may click here to run the sample.

3. Navigate to the Test Form tab of Test View, if necessary.

4. Invoke the createCustomerTable method to create the database table and populate it with test data.

5. Use other methods in the interface to query the database in various ways. Until you insert additional records, valid customer IDs are 1, 2 or 3.

6. Select log entries in the Message Log to see the message traffic involved in each interaction.

7. Examine the source code for CustomerDBClient.jws and CustomerDBControl.ctrl to see how the CTRL file defines database operations and method shape and the web service uses the methods and data structures provided by the Database control.

Related Topics

LuckyNumberDBClient.jws Sample

Controls: Using Resources from a Web Service

Database Control Design Issues

Test View