Skip to content

Latest commit

 

History

History
201 lines (80 loc) · 4.11 KB

File metadata and controls

201 lines (80 loc) · 4.11 KB
slug id type title tabs difficulty timelimit
quarkus-project
yp2e1vrhohvf
challenge
Topic 3 - Qurkus Project Create
title type hostname
Terminal 1
terminal
rhel
title type hostname
Terminal 2
terminal
rhel
intermediate
1000

3. Qurkus Project Create.

3.1. CRUD Application Flow Diagram

3.2. Quarkus App API Connectivity with Database

You can find the source code with instructions used in this blog post in this GitHub repository.

Following is a snapshot of quarkus project directory.

3.3. Run the application

Clone the following Git repository in the Terminal 1 window to create the CRUD quarkus project.

git clone https://github.com/redhat-developer-demos/quarkus-crud-mssql.git

To run quarkus application you have to first check out on application folder which is a quarkus-crud-app

cd quarkus-crud-mssql && quarkus dev

When in the terminal you will get the output like shown above. You are good to go for API testing.

Open Terminal 2

  1. Create a new person

http POST :8080/person firstName=Carlos lastName=Santana salutation=Mr

  1. List a person

http :8080/person

  1. Updating an existing person

http PUT :8080/person/1 firstName=Jimi lastName=Hendrix

  1. Deleting an existing person

http DELETE :8080/person/1

Now with help of API we created, deleted & updated the database. To check all changes are reflected in the database we have to cross-verify. For that Please follow the below steps.

Add one person in Database

http POST :8080/person firstName=Karan lastName=Singh salutation=Mr

First, we need to login into the Microsoft SQL database. For that, we need to use sqlcmd. please run the following command:

sqlcmd -S localhost -U sa -P '123@Redhat'

Now select the sample database which we created earlier.

USE TestDB
GO

List the data from our collection for that run the following command to list all data.

SELECT * FROM Person
GO

After running the above command you will get the following result in your terminal.

Quarkus CRUD application is working fine. Click on Next for containerization of quarkus application.