Phone List www.enhydra.org Kyle Clark, Andy John 2/99 "phoneList" is a demonstration application for querying and updating a list of phone numbers in a database. It has been tested with Informix and Oracle databases. Before building and running phoneList be sure to follow the setup steps outlined below. Setup (required) ----- 1) create a database that contains the tables defined in ./database/create_table.sql 2) Edit the file ./multiserver_local. Search for the variable JDBC_CLASSES. In both places you see "CHANGE_THIS", set the variable to point to the location of your JDBC driver(s) classes. Make sure you use an absolute path name(s). 3) Edit the file ./phoneList/phoneList.conf. You need to provide settings for the JdbcDriver, Connection.Url, Connection.User, and Connection.Password. If you search for the string "CHANGE_THIS" in the file it will take you to the locations where the changes need to be made. The settings depend on the JDBC driver you are using and the database being used. To build and run phoneList: -------------------------- 1) Type "make" in this directory. 2) The application will be compiled, with the resulting class files put in the classes directory. Then a jar file will be created in output/lib. the application's config file will be placed in the directory output. An Enhydra Multiserver config file will also be placed in the output directory, along with a start script. 3) Type "cd output". 4) Type "./start". 5) Use your web browser to access phoneList at: http://localhost:9000 localhost can also be your host name or 127.0.0.1 (best for Win95). Notes ----- 0) If you ever edit the files ./phoneList/phoneList.conf or ./multiserver_local make sure to run "make" afterwards. They get copied into the "output" directory when you run make. 1) If you are wondering why the JDBC driver classes had to be set in the system CLASSPATH (i.e. in ./multiserver_local) read on. If instead you had set them in the phoneList.conf file (Server.ClassPath[]), in which case you'd be using the application's class loader, then the driver may not load correctly. Apparently some type-3 JDBC drivers need to be loaded by the system class loader. For this reason you have to edit the file ./multiserver_local to set the JDBC classes in the system CLASSPATH. 2) This application will not run with a MySQL database. The phoneList application uses a transaction object to update, insert, and delete data from the database. The transaction object uses the commit() and rollback() methods on a JDBC connection. Since these methods are not supported by MySQL phoneList can't be run on MySQL. However phoneList is simple enough that it can be run without real transactions. Somebody could write a "MySQL" database class type that implements a pseudo transaction object. In this case phoneList could be run with MySQL. In the phoneList.conf file the "classType" for the database would have to be changed from "Standard" to "MySQL". The pseudo transaction object wouldn't make use of the commit() and rollback() functionality on a JDBC connection. 3) Since phoneList is a demonstration application it doesn't make any effort to handle any SLQ exceptions. If an exception is ever thrown it will be displayed to the end user on their screen with a stack trace. This can be pretty handy for debugging....