4.2. Running the examples

4.2.1. Bookstore example

The best way to do this is to download the Bookstore example in WAR file which is ready to run with minimal effort. The WAR file can be placed in the webapps directory of Tomcat, for example, and Tomcat will expand it. You may need to add a Context element to Tomcat's server.xml file. The Bookstore example in WAR form contains all dependencies needed to run and uses an in-memory database (HSQL) that does not require additional configuration or installation.

Once these prelimiaries are performed, point your web browser to the host and port where Tomcat (or whatever servelet container or application server you are using) is running and open bookstore/howto/. There are a few examples in this directory and a large number examples under bookstore/tests/ that demonstrate various features of DbForms in the simplest form possible.

4.2.2. Tutorial example

The tutorial example is described in Chapter 7, Tutorial: A sample application including information on how to run it.

4.2.3. Other examples

Please note that the test suite and bugtracker examples include dependencies from earlier releases of DbForms. These dependencies should not be replaced with current dependencies.

  1. Create the database by executing the SQL commands listed in examples/*/WEB-INF/*.sql.
  2. Configure a database connection pool for the new database tables using your favorite technique (either the connection pool built into your application server or codestudio's poolman or another database connection tool). Connection pools are an important technique for speeding up a web application. See Section, “Using arbitrary connection pool” for more information.
  3. Install the DbForms example applications by deploying the directory of the application into your servlet container, using the standard techniques supported by that container.

    For Tomcat, this may be as simple as copying the directory to the $TOMCAT_HOME/webapps directory and restarting Tomcat.

  4. Take a look at /examples/README.txt or other README files in the examples directory!
  5. Finally, using your web browser, go to the host and port and path where the examples should be.