|PROJECT 6: JDBC (this project is worth 5% of the course grade)|
In this project, you will use JDBC to make the database connection. You will also apply some basic SQL operations through your servlet.
1. Create a table in your database that contains all the movie product information we used earlier. You can just include the same15 movies in 3 categories from the previous projects, or you could insert more if you wish. The table creation can be done either by command line input or by invoking the java-database connectivity statements in Java code.
Hand In. Please take a command line output in response to your 'select * from table_name;' in mysql on gemini. The output should be copied and pasted in a text/HTML file, so the TA can see it in browser window. Click here for an example file. Please note that you can create more columns (attributes) in the table than the example shows, but your table should at least have the five attributes as shown in the example.
2. Browse by Database. Modify your existing Java servlet(s) from the previous projects so that all the movie information displayed in the movie tables are retrieved from the database table. For example, if a customer clicks on the 'Favorite' button/link and his/her favorite category is 'Horror', your servlet should execute a query: select * from talbe_name where category='horror'. The results from this SQL statement should be printed in HTML as usual. Also, please update the corresponding stock count when some movie are sold. Thus, if a customer buys one copy of 'Scary Movie', the stock count attribute in your 'Scary Movie' record should be decreased by one, ane all the customers would see the updated stock count when they browse your site. When the stock count reaches zero, the movie cannot be purchased anymore.
3. A New Search Function. Add a search function to your site to perform search by TITLE. If the customer enters a title string into asearch text box and hits the search button/link, a SQL statement should be excuted to find the movie with that title. Either found or not found, a corresponding response should be given to the user. You could design the workflow and UI of the search button/link as well as the response anyway you like.
4. Hand in: Please include in your project table