For this assignment, you are to write a JavaScript-enhanced HTML document. You may choose an example that tries out several JavaScript and DHTML features, such the following:
Image Repository
is a sample application implementing client side interface using Javascript
and DHTML as frontend. (Server side Database backend is to be implemented in the final project.)
The program consists of three distinct modules:
First is the Image Repository frontend module --
ImgRepository.html
, which offers an interface for students to query on image components information;
The second module is the middle-layer Java Servlet --
Control
, which offers communication between client and server.
The third module is the Database Access backend --
myDatabase
, which performs database access through JDBC and sends back query results to client applet for display.
Back to Top Page
Client Interface
ImgRepository is the interface which provides Query for online accessing Image Components Database. User can choose image components by providing information about type and color. The Query will be post to server through Java Servlet. Database access operation is done at server side and matched image components will be sent back to client.
The top lever interface is a window, which consists of three frames:
leftlist
(which implements sliding menu),
banner
(which implements dynamic images toggle), and
main
(which is used for display image components).
EventHandler message are delivered by passing parameters in fucntions,
between the above three frames.
Back to Top Page
Database Backend
myDatabase implements methods to access the Oracle database via JDBC. The API includes open and close connection to database, executeSQL for executing query commands and getRecord for returning multiple records that matches the query. Vector object is used to hold multiple Hashtables as elements, where each record is held by a hashtable. As each query is packaged into a string object that deliverd to execution method. so all of the database access methods in ControlPanel take executeSQL and getRecord as the underline methods. And it is very flexible to expand the functions of query based on this scheme.
I use
oracle.jdbc.driver.OracleDriver
to connect to the Oracle
database on Carver.
The database access of my program is actually done all on server side using the above JDBC driver.
The demo applet works with
Netscape Communicator versions 4.5, 4.04
with AWT 1.1 patch and 4.05 with AWT 1.1 patch on Solaris machines.
To run the demo
Click here
.
Back to Top Page
Source
ImgRepository.html
banner.html
leftlist.html
main.html
Running the program
Back to Top Page
Demo
Back to Homework Page