Project Notes


Project: Sample Applet to Servlet project.
Author: Josh Fletcher
Company: Borland

Description:
An applet built with DataExpress components and a servlet based on DataExpress components that communicate with each other.  The servlet handles query requests sent by the applet;   this example shows how to serialize a DataSetData component on the server side and send it to the client; a similar technique could be used for any object.

NOTE: This is a "hands on" project; you must edit dbApplet.java and dbServlet.java to supply information about your database driver and connection before running.  If you are running this example with JDataStore or InterBase, the strings you need are:
 
If you need help setting this up there is an FAQ available. Please go to the Borland Search page and search for "how do I setup jbuilder to work with with my jdbc drivers".

To test this project, do the following:

  1. Fill in the appropriate database connection infromation in the DbServlet source code (e.g. the database URL, username, password, etc). This information is stored in private member Strings.
  2. Right-Click on "DbServlet.shtml" in the Project Pane and select Run.
  3. Wait for the servlet to load.
  4. The port number in the applet URL may need to be modified in order to successfully connect to the servlet in the IDE. The default port in the IDE is 8080 but may change if that port is occupied. When you run the servlet, observe the port number used to launch it in the Location Bar above the page. If necessary, change this number in the source code of the applet (in the "jbutton1_actionPerfomed()" method).
  5. Right-Click on "DbApplet.html" in the Project Pane and select Run.
  6. After the Applet loads, click the "Invoke Servlet" button.
  7. After the servlet replies, you should see data in the grid in the applet.
Note that this example does not handle resolving changes made to the data back to the database. For information on creating a custom resolver please see the "Streamable DataSets" sample in your JBuilder "samples" directory.