Querying Oracle Database with Web Services

To learn XML DB Web Services, let’s build an application that manages stock trading data.

First, we create the following tables to store the stock trading transactions and client information (create_tables.sql):

CREATE TABLE stock_trans_tbl(

     client id     NUMBER,

     stock id     VARCHAR2(20),

     trans type     VARCHAR2(10),

     shares     NUMBER,

     stock_price     NUMBER);

CREATE TABLE client_tbl(

     client_id     NUMBER,

     username     VARCHAR2(20),

     client_pwd     RAW(16));

Next, we add the following client data (insert_data.sql):

INSERT INTO client_tbl VALUES(1,’jsmith’,


To protect the client password, we use the database utl_raw.cast_to_raw() ...

Get Oracle Database 11g Building Oracle XML DB Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.