Prof. (Dr. ) Harish Kumar MittalProfessor · Researcher · Educator
PBLJ eBook Course contents

Project Based Learning in Java · 24CSH-301 / 24ITH-301

Unit 3 Laboratory Worksheets

Application Programming Interface (API) defines the operations one software component can use to communicate with another. Java Persistence API (JPA) lets Java code save and load objects as database rows. The standard is now called Jakarta Persistence. Create, Read, Update and Delete (CRUD) are the four basic operations used to manage stored records. Representational State Transfer (REST) is an architectural style that organises a web service around resources, such as students or products, accessed through a consistent interface. Course Outcome (CO) states what a learner should be able to do after the course; CO1 to CO5 label the five syllabus outcomes.

Unit 3 moves from enterprise Java concepts to framework-managed applications. Experiment 3.1 covers Spring Core, JPA CRUD, transactions, and error handling. Experiment 3.2 covers REST APIs and design patterns. Experiment 3.3 develops a lab based mini project.

AvailableExperiments 3.1–3.3
Learning evidenceCode, flow diagrams, output, viva, and checklist
Mapped outcomesCO2, CO3, CO4, and CO5

Available

Experiments 3.1–3.3

Build Spring-managed services, persist data through JPA, and keep multi-step database work atomic.

H2 Database Engine (H2) is a Java relational database often used in memory for isolated examples; H2 is a product name, not an acronym. JavaScript Object Notation (JSON) is a text format for exchanging values such as objects, arrays, strings, numbers and booleans.

  • Easy: Auto-wire a StudentService and print four student records.
  • Medium: Demonstrate full Student CRUD with JpaRepository and H2.
  • Hard: Transfer funds transactionally, prove rollback, and return a JSON error.
Open worksheet

Recommended workflow

How to Use Experiment 3.1

  1. Review Spring dependency injection and JPA entity mapping in the Unit 3 theory.
  2. Create separate Spring Boot projects for the Easy, Medium, and Hard levels.
  3. Trace each algorithm and flow diagram before entering the model code.
  4. Run the projects and compare console or JSON output with the worksheet.
  5. Force the Hard-level failure and verify that both account balances remain unchanged.
  6. Complete the viva questions and submission checklist.