This class will cover database applications using SQL and Java as the main programming languages. We will start with simple Java line-oriented user interaction for database applications, and later cover web-based GUIs, working up to web-enabled applications involving database back ends. You need proficient Java programming skills and CS430/630 for SQL, or an equivalent introductory database course covering SQL, E-R diagrams, and client programming (in C, Java or PL/SQL) including elementary transactions. It is good to know basic HTML, including forms, and basic XML, but these topics will be covered in homework. There are plenty of tutorials for HTML and XML on the Web.
We are now using Spring
Boot 2.0 and JSP (Java Server
Pages). Previously (>2 years ago) we used servlets and JSP. The JSPs
involved are essentially the same, but Spring Boot 2 automates much of the
programming effort of servlets and running tomcat,
the application server we will still use.
Teaching Assistant: JohnPaul Kambazza
Note that I also teach CS437/637
Database-Backed Web Sites and Web Services, another web applications
course, usually in the fall. You may take both classes if you wish. Both
classes use databases for holding persistent data and use HTML5 and MVC
for web UI, so there is some overlap. If you want to take both classes in
different terms, please consider taking cs637 first, since it is more
elementary. See
comparison doc. If you are interested in preparing to use .NET, you
should probably take CS436/636, since .NET is an enterprise platform of
similar architecture.
Syllabus
Student Information sheet,
with list of essential skills needed for this course
Text: Java
Servlets and JSP, third edition, by Joel Murach and Andrea
Steelman, Murach & Assoc, 2014, ISBN 978-1-890774-78-3, available for
example at
Amazon or the bookstore. This book cover basic web technology (HTTP,
HTML), servlets, JSP, using the MySQL database, JDBC and tomcat. Follow
the book link for free sample chapters and code.
Getting Ready:
Check out your development PC: A Windows 10 system with at least 4GB of
memory works well with these tools. Alternatively, a Linux system or
recent MacOSX system will work well. Setup directions are provided for
Windows, Linux, and MacOSX.
First week: Get a UNIX/Linux account for cs636 by running apply, even if you already have a UNIX account here. This should be done end of the first week to list your username for Oracle and mysql accounts. Follow the DevelopmentSetup doc for UNIX/Linux and your own home system.
Mon., Jan. 25 slides (6pp)
Intro to client-server and web applications
Wed., Jan. 27 slides (6pp)
Our projects and databases, review of JDBC
Mon., Feb. 1 slides (6pp)
JDBC
Wed., Feb. 3 slides (6pp)
Maven and the pizza1 project
Mon., Feb. 8 slides (6pp)
Database for the Pizza Project, SystemTest, more on domain objects
Wed., Feb. 10 slides (6pp)
The Pizza Project APIs
Mon., Feb. 15 Holiday
Wed., Feb. 17 slides (6pp)
Pizza Project: the Singletons for the APIs
Mon., Feb. 22 slides (6pp)
Music Project, general principles
Wed., Feb. 24 slides (6pp)
Music Project UI and domain classes/objects
Mon., Mar. 1 slides (6pp)
Music Project, JUnit: example (zip)
example with Maven (zip)
Wed., Mar. 3 slides (6pp)
Transactions in JDBC
Mon., Mar. 8 slides (6pp)
Debugging, slides (6pp) HTTP
(Chap. 18)
Wed., Mar. 10 slides (6pp)
Intro to Tomcat and JSP
Mon., Mar. 22 slides (6pp)
Intro to JPA slides (6pp)
Chap. 13 Slides on JPA, part 1
Wed., Mar. 24 slides (6pp)
JPA and pizza2 (zip README)
Mon., Mar. 29 slides (6pp)
Midterm Review
Wed., Mar31 Midterm Exam: Word, HTML,
text. Solution
Mon., Apr. 5 slides (6pp)
Intro to Spring Boot, Servlets slides
(6pp) Chap. 2 slides
Wed., Apr. 7 slides (6pp)
Servlets, JSP, Spring Beans slides
(6pp) Chap. 5 slides
Mon., Apr. 12 slides (6pp)
Servlets, Spring Controllers
Wed., Apr. 14 slides (6pp)
Session Variables slides (6pp) Chap. 7 slides
Wed., Apr. 21 Finish Ch. 7 slides, slides (6pp) Session Variables for pizza3, music3,
SystemTest
Mon., Apr. 26 slides (6pp)
Spring Controllers, including those that accept UI
Wed., Apr. 28 slides (6pp)
DataSource, Connection pooling, Multithreading Concerns
Mon., May 3 slides (6pp)
Multithreading, Guarding Against SQL Injection, Scaling up, Microservices
Wed., May 5 notes Domain Object Design,
Internationalization, Intro to Web Services
Mon., May 10 slides (6pp)
REST Web Services using Spring Boot
Spring REST examples, FYI: tutorial-rest
(zip) (use nonrest subdir) rest-client
(zip)
Wed, May 12 slides (6pp)
Final Review, teacher evaluations: link will be emailed before class
Final Exam Wednesday, May 19 3-6pm using the Zoom link for class. You need working video. Practice Final Exam (Solution)
Final Exam: Word HTML
text. Attend class with video on.
Submit in pdf to Gradescope by 6:05pm
Homework 1 Review, Setup, and Intro/Review of
JDBC, due Monday, Feb. 8 on Gradescope Solution
Homework 2 Java Packages, Pizza Project, XML,
Maven, HTML Forms, due Monday, Feb. 22, on Gradescope Solution
Homework 3 Music DB, Page Flow for pizza, API
design, Java Exceptions, due Wednesday, Mar. 3 on Gradescope Solution
pizza1 (zip) Client-server pizza project (provided example)
Project 1 Client-server Music Project
music1-setup (zip)
Client-server music project starting point
music1 (zip) Music
Project Solution
pizza2 (zip) Client-server
Pizza Project with JPA DAOs. FYI: pizza2S (zip): pizza2 with Spring JPA repositories
(no-code DAOs)
ch05emailS (zip)
Spring Boot version of Murach's ch05email example (using embedded tomcat
but no beans or Spring controllers)
pizza3 (zip) Spring Boot
Pizza Project with Spring Beans and Spring Controllers
Homework 4 JPA, Intro Spring Boot webapps, tomcat (shared and embedded) due Tues., Apr. 20 on Gradescope. Solution
ch07cartS (zip)
Chapter 7 Cart webapp, useful as model for part of project 2
ch07downloadS (zip)
Chapter 7 Download webapp, also useful for project 2
Homework 5 MVC webapps, session variables, pizza3's Spring controllers, due Tues., May 4 by 11pm on Gradescope Solution
Project 2 Music Project Spring Boot Web App, due
Sunday, May 9 by midnight
music3-setup (zip)
music3 starting point Solution: music3 (zip)
Gradescope info How to submit homework, etc.
Access to cs.umb.edu systems from offsite Logging in and transferring files.
Student Information Form (list of needed skills)
Development Setup Installing Java and Maven (if necessary) on your home system. Installing eclipse. A few things needed on cs.umb.edu hosts as well.
Database Setup Setting up direct SQL access for Oracle, setting up the needed tunnels to our database servers, using eclipse to access databases.
Student TCP ports for pe07, for running Spring Boot webapps. Look up your ports in this file.
Java We are using version 8 or 11. pe07 has version 8, so you may need to recompile after delivery there if you are using version 11 at home. JDK API Java classpath explained. javac tool doc java tool doc
eclipse : We are using version 2020-06 or later of the
Eclipse IDE for Java EE
Developers Advanced
Java debugging tips
maven: We are using version 3.3 or later.
SQL Try out SQL queries at sqlzoo.net, Also see product SQL manuals below under Oracle, Mysql, HSQLDB. We will write portable SQL, so one script will work on all three databases, as much as possible.
JDBC: jdbc directory for JdbcCheckup and drivers tutorial Note that the JDBC API is part of the standard Java library. Chap. 12 of Murach has useful coverage.
HTML5: Intro
at www.w3schools.com forms
tutorial tag reference,
with HTML 4/5 info HTML5
validator
Living without Javascript: CSS can do more than you might
think: photo
carosel (wait a bit for this to start) dropdown
in menu bar (also www.cs.umb.edu)
Javascript book for learning essentials of JS and Node.js: Learning
Web App Development, by Semmy Purewal (best to get a print copy,
for example $27 at amazon.com)
XML: XML tutorial at www.w3schools.com. We need basic XML for maven's pom.xml from the start, and for JPA configuration later
JUnit: We are using version 5. Tutorial at baeldung.com
Oracle: We are using version 12c on dbs3.cs.umb.edu. Sign up (free) for Oracle Technical Network. Oracle 12c documentation (SQL) Oracle error messages info.
MySQL: We are using version 5.7 on pe07.cs.umb.edu. docs (SQL)
H2: We are using version 1.4.200 (SQL)
HTTP
tutorial
curl HTTP tool (do HTTP GETs, POSTs using command line,
or from build.xml)
Windows install instructions (usually available on Mac/Linux)
JEE, Java Enterprise Edition (API) We are using version 7, but only certain of its technologies: servlets, JSP, EL, JSTL, and JPA2, so all we need are certain jar files in addition to the Java JDK, plus tomcat to run the servlets.
Apache tomcat, our servlet container, i.e., web server with servlet capability: We are using version 9 via Spring Boot 2 configuration.