08

Database Modification using JDBC and JavaServlets!
100 points
 Purpose:  Build a class registration application using a Java Servlet and your MYSQL database create in Assignment #3

 

Description:

 

Your are to create the necessary xhtml pages and javaSerlvets so you can now register a student for classes.  Using your existing database you must now add the capability to register each student in the database for classes.  Your registration program must be a Java Servlet.  This requires you to add and update the registration tables in your database.  This will require retrieving and modifying data from multiple tables in your MYSQL database.

 

Requirements:

 

  1.  Using the student-id (or name), select a student and display all the courses the student is currently registered for.

  2.  Include the capability to register each student for classes.  The classes must be selected from the courses in your database.

  3.  Automatically redisplay the courses the student is registered for.

  4.  Add the capability to remove a course from the specified student's schedule. 

 

 

Setting up your development environment:

 

1.  Your java class name must assign08 (assign08.java).

     (Remember you class name must match your filename)

     a.  You must place the servlet program in the directory I created for you in the following directory:

          home/ercanbracks/tomcat55/tomcat/webapps/cs313/WEB-INF/classes/s13/yourNetId

     b.  set the permissions on your java source file to rwx for owner only: (e.g. chmod  700 myfile.java)

     c.  you must include a package statement in the beginning for your java source file as follows:

           package s13.yourNetId;

2.  To compile your servlet program:    javac6 -classpath  ../../j2ee.jar assign08.java

 

3.  You will use the tomcat application server running on Jordan (157.201.194.254) to run your servlets

 

4.  To test your servlet -  from the browser enter:   http://157.201.194.254/~yourNetId/assign08.html 

                                                                             or http://157.201.194.254:8080/~yourNetId/assign08.html

 

                                     or execute it directly by:   http://157.201.194.254:8080/cs313/servlet/s13.yourNetId.assign08

   

     Warning:  If your assign08.html uses AJAX to request the execution of the servlet, you must use the tomcat web server

                      instead of the apache web server.  (i.e.  http://157.201.194.254:8080/~yourNedId/assign08.html)

                      If you request your assign08.html using the default port 80 it will use apache web server and you will

                      get an access denied from your ajax request.

 

5.  Once your servlet is finished, you will need to "submit" your java file so I can grade your java servlet

     Your .java and .class files need to remain in WEB-INF/classes.  However, I need a copy of your java source file

     submitted to me, so I can view it.  You can run submit from this directory and submit your java source file.

     Be sure you have the proper heading comment block in your java source file so the submit will work properly.

      /***************************

     *   Program:  

     *      Assignment 08, Java Servlet

     *      Brother Ercanbrack, cs313

     ***************************/

 

:Note: Tomcat will check your servlet (java class file) and if it has been modified within the last 15 to 30 seconds it will reload your servlet.  So with about 20 seconds after compiling your servlet, you should be able to see the changes through the browser.