A layered Java application for managing school contacts and student data, built following OOP principles and the DAO (Data Access Object) pattern. Data is persisted in an embedded H2 database and can also be loaded from CSV files. Includes a full suite of JUnit tests covering OOP, JDBC, and business logic layers.
- Load Contacts and Students from CSV files
- Persist and query data using JDBC with H2 embedded database
- Full CRUD operations via DAO layer (ContactDAO, StudentDAO)
- Business logic service layer (ContactBLService, SchoolDataService)
- Projection support (StudentContactProjection)
- 9 test classes organised by layer: OOP, JDBC, and Business Logic
| Component | Technology |
|---|---|
| Language | Java |
| Database | H2 (embedded, in-memory/file) |
| DB Access | JDBC |
| Testing | JUnit |
| Build | IntelliJ IDEA project (.iml) |
| Dependency | H2 JAR (lib/h2-2.3.232.jar) |
java-school-app/
├── src/
│ ├── main/fr/epita/fund/
│ │ ├── datamodel/
│ │ │ ├── Contact.java # Contact entity
│ │ │ ├── Student.java # Student entity
│ │ │ └── projections/
│ │ │ └── StudentContactProjection.java # Joined projection
│ │ ├── services/
│ │ │ ├── ContactDAO.java # JDBC CRUD for contacts
│ │ │ ├── StudentDAO.java # JDBC CRUD for students
│ │ │ ├── ContactCSVReader.java # Parse contacts from CSV
│ │ │ ├── StudentCSVReader.java # Parse students from CSV
│ │ │ ├── ContactBLService.java # Business logic layer
│ │ │ ├── SchoolDataService.java # Orchestration service
│ │ │ └── DatabaseConnection.java # JDBC connection manager
│ │ └── launcher/
│ │ └── Main.java # Entry point
│ └── test/fr/epita/fund/tests/
│ ├── TestOOP1.java # OOP model tests
│ ├── TestOOP2.java
│ ├── TestJDB1.java # JDBC layer tests
│ ├── TestJDB2.java
│ ├── TestJDB3.java
│ ├── TestJDB4.java
│ ├── TestJDB5.java
│ ├── TestBLI1.java # Business logic tests
│ ├── TestBLI2.java
│ └── TestBLI3.java
├── resources/
│ ├── contacts.csv # Sample contact data
│ ├── students.csv # Sample student data
│ ├── create-contacts.sql # DDL for contacts table
│ └── create-students.sql # DDL for students table
└── lib/
└── h2-2.3.232.jar # H2 embedded database
email, first_name, last_name, address, city, country, birthdate
(inherits or relates to Contact) — see Student.java for full fields
- Java 11+
- IntelliJ IDEA (recommended) or any Java IDE
- Open the
java-school-appfolder as a project - Make sure
lib/h2-2.3.232.jaris added to the module classpath - Run individual test classes under
src/test/to verify functionality
Open any test class (e.g., TestJDB1.java) and run it directly. Tests are self-contained and use the H2 in-memory database — no external database setup needed.
CSV Files / SQL DDL
↓
ContactCSVReader / StudentCSVReader (parsing layer)
↓
ContactDAO / StudentDAO (JDBC persistence layer)
↓
ContactBLService / SchoolDataService (business logic layer)
↓
Main / Tests (entry points)
Ganpat Patel EPITA MS — Semester 2 | Object-Oriented Analysis, UML & Java