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

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

Unit 2 Laboratory Worksheets

Application Programming Interface (API) defines the operations one software component can use to communicate with another. Java Database Connectivity (JDBC) is Java's standard interface for connecting to relational databases, issuing statements and reading results. Model-View-Controller (MVC) separates application data and rules, user-facing presentation, and request or input handling. Course Outcome (CO) states what a learner should be able to do after the course; CO1 to CO5 label the five syllabus outcomes.

Unit 2 covers advanced Java programming and database connectivity. Experiments 2.1 to 2.4 are available, moving from the Collections Framework and synchronised multithreading through wrapper classes, serialisation, and file handling, to lambda expressions and the Stream API, then JDBC, transactions and MVC. Each worksheet has Easy, Medium and Hard tasks.

Available Experiments 2.1 to 2.4
Learning evidence Programs, sample output, viva, and submission checklist
Mapped outcomes CO2, CO3, and CO4

Available

Collections, Threads, Files, Streams and JDBC

Manage and manipulate data with the Collections Framework, then coordinate concurrent access with synchronised threads.

  • Easy: Store employee records in an ArrayList with add, update, remove, and search.
  • Medium: Collect and look up playing cards by symbol using the Collection interface.
  • Hard: Build a ticket booking system with synchronised threads and thread priority.
Open worksheet

Convert between primitives and wrapper objects, then make program data outlive the program by writing objects to files.

  • Easy: Total a list of integers using autoboxing, unboxing, and wrapper parsing.
  • Medium: Serialise a Student object to a file and read it back with full exception handling.
  • Hard: Menu-driven employee records saved to and reloaded from a file.
Open worksheet

Replace loops and boilerplate comparators with lambda expressions, then process collections declaratively with the Stream API.

  • Easy: Sort employees by name, age, and salary using lambda comparators.
  • Medium: Filter students above 75%, sort by marks, and display their names with streams.
  • Hard: Group products by category, find the costliest in each, and average all prices.
Open worksheet
2.4

JDBC Connectivity, CRUD Operations, and MVC

Create, Read, Update and Delete (CRUD) are the four basic operations used to manage stored records.

CO3, CO4

Connect Java to MySQL, protect changes with transactions, and organise database code using MVC.

  • Easy: Connect to MySQL and display every Employee record.
  • Medium: Perform menu-driven Product CRUD with prepared statements and transactions.
  • Hard: Build Student CRUD with separate Model, View, and Controller classes.
Open worksheet Run Easy online →

Recommended workflow

How to use each worksheet

  1. Review the prerequisite concepts and prepare the required software or database.
  2. Attempt the problem statement and algorithm before reading the model implementation.
  3. Compile the program and compare its output with the sample.
  4. Test valid, boundary, and invalid cases.
  5. Complete the viva questions and submission checklist.