Changes between Version 1 and Version 2 of PrototypeImplementation


Ignore:
Timestamp:
06/19/26 00:00:35 (2 days ago)
Author:
223091
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PrototypeImplementation

    v1 v2  
    7474
    7575The application uses JDBC to connect to PostgreSQL and execute the SQL statements needed for the implemented scenarios.
    76 
    77 = Build Instructions =
    78 
    79 == Development environment description ==
    80 
    81 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.
    82 
    83 Required software:
    84 
    85 * Java JDK 21 or compatible newer Java version
    86 * IntelliJ IDEA
    87 * Maven
    88 * PostgreSQL JDBC driver, included through Maven
    89 * DBeaver, used for database verification
    90 * SSH tunnel script provided through the EPRMS / Databases section
    91 
    92 The project structure is:
    93 
    94 {{{
    95 room-reservation-prototype
    96 ├── pom.xml
    97 ├── README.md
    98 └── src
    99 └── main
    100 └── java
    101 └── mk
    102 └── finki
    103 └── roomreservation
    104 └── App.java
    105 }}}
    106 
    107 == Database connection requirements ==
    108 
    109 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:
    110 
    111 {{{
    112 localhost:9999
    113 }}}
    114 
    115 The application uses the following JDBC URL:
    116 
    117 {{{
    118 jdbc:postgresql://localhost:9999/db_202526z_va_prj_room_reservation
    119 }}}
    120 
    121 The database username is:
    122 
    123 {{{
    124 db_202526z_va_prj_room_reservation_owner
    125 }}}
    126 
    127 The database password is the database user password assigned in the EPRMS system.
    128 
    129 Important: real passwords are not written in the source code or in this documentation. The password is entered manually when starting the application.
    130 
    131 == Starting the SSH tunnel ==
    132 
    133 Before starting the Java prototype, the SSH tunnel script must be started.
    134 
    135 Steps:
    136 
    137 1. Open the folder containing the provided tunnel script and ''plink''.
    138 2. Open PowerShell or Command Prompt in that folder.
    139 3. Start the tunnel script.
    140 4. Enter the SSH tunnel parameters provided in the EPRMS system if they are not already configured in the script.
    141 5. Keep the tunnel window open while the Java prototype is running.
    142 
    143 The tunnel must remain active during the entire test. If the tunnel window is closed, the Java application will lose access to the database.
    144 
    145 == Build instructions ==
    146 
    147 Open the project in IntelliJ IDEA.
    148 
    149 1. Open IntelliJ IDEA.
    150 2. Choose ''Open'' and select the ''room-reservation-prototype'' project folder.
    151 3. Make sure that the project SDK is set to Java JDK 21 or compatible.
    152 4. Wait until Maven imports the project dependencies.
    153 5. Open ''src/main/java/mk/finki/roomreservation/App.java''.
    154 6. Run the ''App'' class.
    155 
    156 The project can also be compiled with Maven using:
    157 
    158 {{{
    159 mvn clean package
    160 }}}
    161 
    162 == Running the application ==
    163 
    164 After starting the application, the program asks for database connection parameters.
    165 
    166 Use the default database URL by pressing Enter:
    167 
    168 {{{
    169 jdbc:postgresql://localhost:9999/db_202526z_va_prj_room_reservation
    170 }}}
    171 
    172 Use the default database username by pressing Enter:
    173 
    174 {{{
    175 db_202526z_va_prj_room_reservation_owner
    176 }}}
    177 
    178 Enter the assigned database password manually when prompted.
    179 
    180 If the connection is successful, the application displays:
    181 
    182 {{{
    183 Connected to database successfully.
    184 }}}
    185 
    186 Then the main menu is shown:
    187 
    188 {{{
    189 Main menu
    190 
    191 1. Search available rooms
    192 2. Create reservation request
    193 3. Approve or reject reservation
    194 4. Exit
    195    Choose option:
    196    }}}
    197 
    198 == Testing instructions ==
    199 
    200 The prototype should be tested by executing the three implemented scenarios.
    201 
    202 === Test 1: Search available rooms ===
    203 
    204 Select option:
    205 
    206 {{{
    207 1
    208 }}}
    209 
    210 Example input:
    211 
    212 {{{
    213 Reservation date: 2026-03-01
    214 Start time: 09:00
    215 End time: 10:00
    216 Minimum capacity: 1
    217 Room type filter:
    218 Required equipment name:
    219 }}}
    220 
    221 Expected result:
    222 
    223 The system displays a list of available rooms with room code, type, capacity, building name, and address.
    224 
    225 === Test 2: Create reservation request ===
    226 
    227 Select option:
    228 
    229 {{{
    230 2
    231 }}}
    232 
    233 Example input:
    234 
    235 {{{
    236 Choose user number: 1
    237 Reservation date: 2026-03-01
    238 Start time: 09:00
    239 End time: 10:00
    240 Include room in reservation: y
    241 Minimum capacity: 1
    242 Room type filter:
    243 Required equipment in room:
    244 Choose room number: 3
    245 Request additional/general equipment: n
    246 }}}
    247 
    248 Expected result:
    249 
    250 The system creates a new reservation request and displays the generated reservation ID. The created reservation has status ''pending''.
    251 
    252 === Test 3: Approve or reject reservation ===
    253 
    254 Select option:
    255 
    256 {{{
    257 3
    258 }}}
    259 
    260 Example input:
    261 
    262 {{{
    263 Choose reservation number: 2
    264 Choose approver number: 1
    265 Choose decision: 1
    266 Decision note: Approved after checking room availability.
    267 }}}
    268 
    269 Expected result:
    270 
    271 The system saves the approval decision, updates the reservation status to ''approved'', and displays the final reservation details.
    272 
    273 == Database verification ==
    274 
    275 The result can be verified in DBeaver by executing the following SQL statements:
    276 
    277 {{{
    278 SELECT *
    279 FROM project.reservations
    280 ORDER BY reservation_id DESC;
    281 
    282 SELECT *
    283 FROM project.approvals
    284 ORDER BY approval_id DESC;
    285 }}}
    286 
    287 The created reservation should appear in the ''project.reservations'' table, and the approval decision should appear in the ''project.approvals'' table.
    288 
    289 == Notes ==
    290 
    291 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.