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:
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 )
Load the book data from the operating system command-line with SQL*Loader:
% sqlldr userid=ctxdemo/ctxdemo control=loader.ctl
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; /
You can create the CTXCAT index from SQL*Plus as follows:
CTXCAT
sqlplus>create index book_idx on book_catalog (title) indextype is ctxsys.ctxcat parameters('index set bookset');
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
When you do so, you can access the application from a browser. The URL should be http://localhost:port/path/catalogSearch.jsp
http://
:
/
/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
Scripting on this page enhances content navigation, but does not change the content in any way.