We will create a simple standalone Java application so that it is easy for you to learn how to profile using VisualVM. Although it will be a standalone application, we will create classes that are similar to those we created for the CourseManagement
web application in some of the previous chapters, particularly CourseDTO
, CourseBean
(JSP bean), CourseService
(service bean), and CourseDAO
(for database access).
- Create a standard Java project in Eclipse, named
CourseManagementStandalone
. Create theCourseDTO
class in thepackt.jee.eclipse.profile.dto
package:
package packt.jee.eclipse.profile.dto; public class CourseDTO { private int id; private String name; private int credits; //skipped Getters and Setters }
- Create the
CourseDAO
class in thepackt.jee.eclopse.profile.dao
package:
//skipped imports public class CourseDAO { public List<CourseDTO> getCourses() { //No real database access takes place here //We...