Big Project about Book Management with Java OOP
MIT License
Big Project about Book Management with Java OOP (Learining purpose)
1.1 After press install, and next.
1.2 You now in "Select Components" part
1.3 Uncheck Stack Builder
1.4 press next, until you meet password for superuser type your own password
default port is 5432
1.5 keep pressing next until it in "Installing" part.
1.6 Wait for it done, and Finish. DONE!
Default install path is:
C:\Program Files\PostgreSQL\16\bin
Open system enviroment variable on Windows.
psql -V
# Output : psql (PostgreSQL) 16.4
createdb -U postgres book-management
enter your password from #1.4
We using the default superuser "postgres" here
psql -U postgres
# then in the console
postgres=#
# type \l (not the number 1)
postgres=# \l
\q to quit the console or Ctrl + C
Open the Terminal in the project folder (root) follow this
The book-management.sql is in the root of the project (using relative path to import the database)
If book-management.sql
is in the root of the project then run this command
psql -U postgres -f .\book-management.sql book-management
---------^username----^file path----------- ^database name
psql -U postgres -d book-management
# then in the console
SELECT author FROM book LIMIT 5; # to see the data
Download maven from https://maven.apache.org/download.cgi
Extract the zip file to the desired location
C:\apache-maven-3.9.9
(make sure there is a folder bin
in the apache-maven-3.9.9
folder)Add the maven path to the system environment variable
Path
in the user sectionC:\apache-maven-3.9.9\bin
Verify the maven installation
mvn -v
# Output : Apache Maven 3.9.9
Download GraalVM from https://www.graalvm.org/downloads/
Extract the zip file to the desired location
C:\Program Files\Java\graalvm-jdk-22.0.2+9.1\bin
(make sure there is a folder bin
in the graalvm-jdk-22.0.2+9.1
folder)Add the GraalVM path to the system environment variable
Path
in the user sectionC:\Program Files\Java\graalvm-jdk-22.0.2+9.1\bin
Verify the GraalVM installation
java -version
# Output :
# java version "22.0.2" 2024-07-16
# Java(TM) SE Runtime Environment Oracle GraalVM 22.0.2+9.1 (build 22.0.2+9-jvmci-b01)
# Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 22.0.2+9.1 (build 22.0.2+9-jvmci-b01, mixed mode, sharing)
git clone https://github.com/neilfranci/book-management-SJPM.git
2.1 VSCode
cd to the project folder
cd book-management-SJPM
then open the project in vscode with this command
code .
install vs code extension for java https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack
then wait for the extension to install
mvn clean install
.env
file)create a new file .env
in the root and copy the content from .env.template
to .env
replace the value with your own value
mvn spring-boot:run
mvn clean package -Pnative
.\taget
(the native image is a single file) in this case the file is bookmanagement.exe
Answer: Just drop the database
dropdb -U postgres book-management
Answer: Data Transfer Object (DTO) is a design pattern used to transfer data between data access objects and value objects. The data is transferred in the form of data transfer objects. DATABASE Class > Repository Class > Service Class > Controller Class > DTO Class > Sendalbe Data to Client