Building the JSP Web Application

This application models an online bookstore where you can look up book titles and prices.

The following steps describe the process for creating the JSP Web application:

  1. Create Your Table

    You must create the table to store book information such as title, publisher, and price. From SQL*Plus:

    sqlplus>create table book_catalog (
              id        numeric,
              title     varchar2(80),
              publisher varchar2(25),
              price     numeric )
    
  2. Load data using SQL*Loader

    Load the book data from the operating system command-line with SQL*Loader:

    % sqlldr userid=ctxdemo/ctxdemo control=loader.ctl
    
  3. Create the index set

    You can create the index set from SQL*Plus:

    sqlplus>begin
              ctx_ddl.create_index_set('bookset');
              ctx_ddl.add_index('bookset','price');
              ctx_ddl.add_index('bookset','publisher');
            end;
    /
    
  4. Create the CTXCAT index

    You can create the CTXCAT index from SQL*Plus as follows:

    sqlplus>create index book_idx on book_catalog (title) 
            indextype is ctxsys.ctxcat
            parameters('index set bookset');
    
  5. Try a simple search using CATSEARCH

    You can test the newly created index in SQL*Plus as follows:

    sqlplus>select id, title from book_catalog 
            where catsearch(title,'Java','price > 10 order by price') > 0
    
  6. Copy the catalogSearch.jsp file to your Web site JSP directory

    When you do so, you can access the application from a browser. The URL should be http://localhost:port/path/catalogSearch.jsp

    The application displays a query entry box in your browser and returns the query results as a list of HTML links. See Figure B-1.

Figure B-1 Screen shot of Web Query Application

Description of
Description of "Figure B-1 Screen shot of Web Query Application"