JSDK

Home Useful Info 1 Pre-Test1 Project + Milestone 1 Sample Use Cases How to Install DukeBookStore Pre-Test2 JSDK Milestone 2 Final Milestone Announcements Running JSDK at Home Project Team Evaluation Project Information Form ODBC Data Source

 

Running Servlets with JSDK

  1. Start the JSDK web server by double clicking on the Start … Server icon in the Java Tools folder (or go to the root directory of the JSDK (e.g., d:\jskd) and type "startserver")
  2. Copy your servlet bytecode into the D:\jsdk\examples\WEB-INF\servlets directory and copy your HTML documents into the D:\jsdk\examples\servlets directory.
  3. To test your servlets, simply type http://localhost:8080/examples/servlet/YourServlet (where YourServlet is the name of the servlet that you want to test) in the browser. Note that the default port is 8080 and subdirectory is servlet (without the ‘s’).
  4. To serve HTML pages, simply type http://localhost:8080/examples/servlets/myDoc.html. Note that the subdirectory is servlets (with the ‘s’ this time (confusing enough? J )).
  5. If you need to recompile your servlet, you need to:
    1. Edit the source
    2. Recompile the source
    3. Copy the bytecode (i.e., .class file) into the D:\jsdk\examples\WEB-INF\servlets directory.
    4. Stop the web server! (Just close the web server MS-DOS window that was opened when you started the server (or go to the root directory of the JSDK (e.g., d:\jskd) and type "stopserver"). This is to make sure the servlet is reloaded.
    5. Restart the web server (i.e., back to Step 1)

Setting Up an Access DataStore for your JDBC-ODBC Java Programs

  1. Double click on the Start | Setting | Control Panel | 32 Bit ODBC icon. Will see the ODBC Data Source Administrator screen.
  2. On the User DSN tab, click Add.
  3. Will see the Create New Data Source screen.
  4. Select Microsoft Access Driver and click Finish.
  5. Will see the ODBC Microsoft Access 97 Setup screen. Under Data Source Name, enter the name that you want to have associated with the database, e.g., eCommerceDB. (This is the same name that you need to use when specifying the DB URL in your program, e.g., jdbc:odbc:eCommerceDB.)
  6. Click on the Select … button to select the file that is associated with your database (e.g., c:\somedir\myDb.mdb). This assumes that you have already created an Access database using Access earlier.
  7. Click OK
  8. Click OK again to leave the ODBC Data Source Administrator screen.