Summary
In this chapter, we learned how to build web applications that require accessing data from a relational database. First, we built a simple Course Management application using JDBC and JSTL, and then, the same application was built using JPA and JSF.
JPA is preferred to JDBC because you end up writing a lot less code. The code to map object data to relational data is created for you by the JPA implementation. However, JDBC is still being used in many web applications because it is simpler to use. Although JPA has a moderate learning curve, JPA tools in Eclipse EE can make using JPA APIs a bit easier, particularly configuring entities, relationships, and persistence.xml
.
In the next chapter, we will deviate a bit from our discussion on JEE and see how to write and run unit tests for Java applications. We will also see how to measure code coverage after running the unit tests.