© Dave Wolf, A.J. Henley 2017

Dave Wolf and A.J. Henley, Java EE Web Application Primer, https://doi.org/10.1007/978-1-4842-3195-1_8

8. The Service Layer

Dave Wolf and A. J. Henley2

(1)New York, USA

(2)Washington, D.C., District of Columbia, USA

Your application will interact with the DAO through the service layer.

Create a DbUtilities Class

Every time your application connects to the database , it will execute the same code. You can make your application more efficient by creating a class of reusable methods that you can call as needed. Create a class called DbUtilities. This will allow you to simplify calling the Entity Manager when you need to read or write to the database. This class will be static (no instantiation required). It will have one ...

Get Java EE Web Application Primer: Building Bullhorn: A Messaging App with JSP, Servlets, JavaScript, Bootstrap and Oracle now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.