Skip to content

Latest commit

 

History

History
217 lines (150 loc) · 5.37 KB

File metadata and controls

217 lines (150 loc) · 5.37 KB

UNIWA

UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS

University of West Attica · Department of Computer Engineering and Informatics


Software Engineering

Preze Cinemas Desktop - Phase 4
Source Code

Vasileios Evangelos Athanasiou
Student ID: 19390005

GitHub · LinkedIn


Supervision

Supervisor: Georgios Prezerakos, Professor

UNIWA Profile · LinkedIn


Athens, August 2023



INSTALL

Preze Cinemas Desktop - Phase 4 Source Code

This guide will help you set up and run the Preze Cinemas Desktop application on your local machine.


1.Prerequisites

1.1 Software Requirements

1.2 Optional Tools

  • Command-line terminal
  • Text editor for configuration file edits

2. Clone the Repository

git clone https://github.com/Preze-Cinemas-Desktop/Code.git
cd Code

The project folder structure:

assign/
CinemaApplication/
README.md

CinemaApplication/ contains:

  • src/ → Java source files for GUI and business logic
  • build/ → compiled .class files
  • nbproject/ → NetBeans project files
  • build.xml → build script
  • manifest.mf → JAR packaging file

3. Set Up MySQL Databases

The application requires two databases: cinema and bank.

3.1 Create Databases

  1. Log in to MySQL:
mysql -u root -p
  1. Create databases:
CREATE DATABASE cinema;
CREATE DATABASE bank;

3.2 Import Schema and Sample Data

If .sql scripts are provided in the repository (e.g., CinemaApplication/database/), import them:

mysql -u root -p cinema < cinema_schema.sql
mysql -u root -p bank < bank_schema.sql

If no scripts are provided, manually create tables according to the project documentation:

  • Cinema Database Tables: movies, screenings, seats, reservations, customers
  • Bank Database Tables: accounts, transactions, balances

4. Configure Database Connection in Java

Open the main configuration file (or CinemaApplication.java/BankSystem.java) and check the JDBC connection strings:

String urlCinema = "jdbc:mysql://localhost:3306/cinema";
String urlBank = "jdbc:mysql://localhost:3306/bank";
String user = "root";
String password = "your_mysql_password";

Update the username and password to match your MySQL setup.


5. Open Project in NetBeans

  1. Launch NetBeans IDE.
  2. Click File → Open Project.
  3. Navigate to CinemaApplication/ and select the folder.
  4. NetBeans should detect the project as a Java application.
  5. Wait until the IDE fully loads the project and resolves dependencies.

6. Build the Application

  1. Right-click the project → Clean and Build.
  2. Check for compilation errors in the Output window.
  3. The executable .class files will be generated in build/.

7. Run the Application

Right-click the main class CinemaApplication.java → Run File.

Or run from command line:

cd CinemaApplication/build/classes
java cinemaapplication.CinemaApplication

8. Using the Application

  1. Login or Register: Start by creating a new user or logging in.
  2. Choose Movie: Select a movie and screening time.
  3. Select Tickets: Pick the number and type of tickets.
  4. Check Availability: Ensure tickets are available.
  5. Payment: Simulated via BankSystem.
  6. Download Receipts/Tickets: Save outputs as .txt.

9. Troubleshooting

  • JDBC Driver Not Found: Ensure mysql-connector-java.jar is in the classpath.
  • Database Connection Error: Verify credentials and MySQL service status.
  • GUI Issues: Use NetBeans’ “Clean and Build” to resolve corrupted Swing layouts.
  • Payment Validation Errors: Ensure bank database contains sufficient account balances.