A JavaFX desktop application for bar inventory management at TopSportBaras. Staff can record item consumption and update warehouse stock, with all data persisted to a MySQL database.
- Record consumption of drinks and cigarettes with single-click buttons
- Add new stock to the warehouse
- View current inventory levels in real-time
- Persistent storage via MySQL
Tracked items: Beer (0.5L), Whisky (40ml), Cognac (40ml), Coffee, Cigarettes, Tokens
- Java 8+
- MySQL Server running on
localhost:3306
Create the database and table:
CREATE DATABASE mokymai;
USE mokymai;
CREATE TABLE baras1 (
id INT PRIMARY KEY,
name VARCHAR(100),
kiekis DECIMAL(10, 3)
);
INSERT INTO baras1 (id, name, kiekis) VALUES
(1, 'Alus', 0),
(3, 'Konjakas', 0),
(4, 'Viskis', 0),
(5, 'Kava', 0),
(6, 'Cigaretes', 0),
(7, 'Zetonai', 0);The default connection uses:
- URL:
jdbc:mysql://localhost:3306/mokymai - Username:
root - Password: (empty)
To change these, edit baras/src/sample/Database.java.
From IntelliJ IDEA:
- Open the project in IntelliJ IDEA.
- Ensure all JARs in
baras/lib/are on the project classpath. - Run
Main.java.
From the command line:
# Compile
javac -cp "baras/lib/*" baras/src/sample/*.java -d baras/out/production/baras/
# Run
java -cp "baras/lib/*:baras/out/production/baras/" sample.MainBaroApp/
├── baras/
│ ├── lib/ # JAR dependencies
│ │ ├── commons-dbcp2-2.1.1.jar
│ │ ├── commons-pool2-2.4.2.jar
│ │ ├── commons-logging-1.2.jar
│ │ └── mysql-connector-java-5.0.8-bin.jar
│ └── src/sample/
│ ├── Main.java # Entry point, main window
│ ├── Database.java # MySQL connection and queries
│ ├── KiekiuSaugykla.java # In-memory inventory state
│ ├── SandelisScene.java # Warehouse update window
│ ├── MygtukuIvestisInt.java # Integer input dialog
│ ├── MygtukuIvestisFloat.java# Float input dialog
│ └── Style.css # UI styling
| Library | Version |
|---|---|
| MySQL Connector/J | 5.0.8 |
| Apache Commons DBCP2 | 2.1.1 |
| Apache Commons Pool2 | 2.4.2 |
| Apache Commons Logging | 1.2 |