wiki:BuildInstructions

Build Instructions

Development environment description

The prototype application is implemented as a Java console application using Maven. It connects to the PostgreSQL project database through an SSH tunnel. The application uses JDBC for database access.

Required software:

  • Java JDK 21 or compatible newer Java version
  • IntelliJ IDEA
  • Maven
  • PostgreSQL JDBC driver, included through Maven
  • DBeaver, used for database verification
  • SSH tunnel script provided through the EPRMS / Databases section

The project structure is:

room-reservation-prototype
├── pom.xml
├── README.md
└── src
└── main
└── java
└── mk
└── finki
└── roomreservation
└── App.java

Database connection requirements

The application does not connect directly to the remote database server. The SSH tunnel must be started first. The provided tunnel script opens access to the PostgreSQL database through:

localhost:9999

The application uses the following JDBC URL:

jdbc:postgresql://localhost:9999/db_202526z_va_prj_room_reservation

The database username is:

db_202526z_va_prj_room_reservation_owner

The database password is the database user password assigned in the EPRMS system.

Important: real passwords are not written in the source code or in this documentation. The password is entered manually when starting the application.

Starting the SSH tunnel

Before starting the Java prototype, the SSH tunnel script must be started.

Steps:

  1. Open the folder containing the provided tunnel script and plink.
  2. Open PowerShell or Command Prompt in that folder.
  3. Start the tunnel script.
  4. Enter the SSH tunnel parameters provided in the EPRMS system if they are not already configured in the script.
  5. Keep the tunnel window open while the Java prototype is running.

The tunnel must remain active during the entire test. If the tunnel window is closed, the Java application will lose access to the database.

Build instructions

Open the project in IntelliJ IDEA.

  1. Open IntelliJ IDEA.
  2. Choose Open and select the room-reservation-prototype project folder.
  3. Make sure that the project SDK is set to Java JDK 21 or compatible.
  4. Wait until Maven imports the project dependencies.
  5. Open src/main/java/mk/finki/roomreservation/App.java.
  6. Run the App class.

The project can also be compiled with Maven using:

mvn clean package

Running the application

After starting the application, the program asks for database connection parameters.

Use the default database URL by pressing Enter:

jdbc:postgresql://localhost:9999/db_202526z_va_prj_room_reservation

Use the default database username by pressing Enter:

db_202526z_va_prj_room_reservation_owner

Enter the assigned database password manually when prompted.

If the connection is successful, the application displays:

Connected to database successfully.

Then the main menu is shown:

Main menu

1. Search available rooms
2. Create reservation request
3. Approve or reject reservation
4. Exit
   Choose option:

The prototype does not use separate application usernames or passwords. The listed users in the menu are sample database records used for selecting requesters and approvers. The only password needed to run the prototype is the database password assigned in EPRMS.

Testing instructions

The prototype should be tested by executing the three implemented scenarios.

Test 1: Search available rooms

Select option:

1

Example input:

Reservation date: 2026-03-01
Start time: 09:00
End time: 10:00
Minimum capacity: 1
Room type filter:
Required equipment name:

Expected result:

The system displays a list of available rooms with room code, type, capacity, building name, and address.

Test 2: Create reservation request

Select option:

2

Example input:

Choose user number: 1
Reservation date: 2026-03-01
Start time: 09:00
End time: 10:00
Include room in reservation: y
Minimum capacity: 1
Room type filter:
Required equipment in room:
Choose room number: 3
Request additional/general equipment: n

Expected result:

The system creates a new reservation request and displays the generated reservation ID. The created reservation has status pending.

Test 3: Approve or reject reservation

Select option:

3

Example input:

Choose reservation number: 2
Choose approver number: 1
Choose decision: 1
Decision note: Approved after checking room availability.

Expected result:

The system saves the approval decision, updates the reservation status to approved, and displays the final reservation details.

Database verification

The result can be verified in DBeaver by executing the following SQL statements:

SELECT *
FROM project.reservations
ORDER BY reservation_id DESC;

SELECT *
FROM project.approvals
ORDER BY approval_id DESC;

The created reservation should appear in the project.reservations table, and the approval decision should appear in the project.approvals table.

Notes

The prototype is intentionally minimal. It demonstrates the essential database operations required for the selected use-cases, but it is not a complete production application. The completion and extension of the application can be done in later project phases.

Last modified 8 hours ago Last modified on 06/19/26 09:03:39
Note: See TracWiki for help on using the wiki.