At this point, each student should be able to demonstrate a basic ability to work with servlets. For this milestone, you have two choices. Choose either milestone delivery but not both (unless you're overcome with time and ambition). The level of difficulty is approximately the same for each, but perhaps the second option is less useful but more fun. Delivery of either will satisfy the requirement for milestone 1, and both count equally.
OPTION 1
Create a servlet that essentially performs as a poor-person's Interactive SQL interface. The servlet will offer a multi-line edit box that will allow users to enter a SQL command. There will be a button called "Go" that will cause that SQL command to be executed (the connection and URL can be hardcoded in the servlet). Another button, "Clear", will clear out the text and allow a new command to be entered.
Once the user has selected "Go", the servlet will execute the SQL statement
on behalf of the client, and will receive a ResultSet back at which point the
servlet must (a) extract the data and column names and (b) convert that to an
html table and (c) return that to the client for display. That display
should look reasonably professional, like this (at a minimum):
Column 1 Name | Column 2 Name | Column 3 Name | Column 4 Name | Column 5 Name |
data | data | data | data | data |
data | data | data | data | data |
Of course, that display would be relevant if the user entered a query. What if the user enters an update? In that case, your servlet should return the SQL return for the command, often the number of rows affected:
5 rows affected
or something like that. Among the other capabilities you might wish to include in your Servlet isql application (for extra credit):
support for multiple result sets
support multiple queries separated by a "go" instruction
Include a button that "Begins" a transaction and rename the
"Go" button to the "Send" button and then add an "End" button, which submits the
transaction
OPTION 2
Create a servlet that implements the logic and database access for a hangman
game. For complete instructions and more information, follow the
instructions here.
Deliverables:
Demonstration of one of the above options via a URL that we can hit for
testing and delivery of all HTML and Java Source code for the application.
We will
detail specific delivery instructions.