slug | id | type | title | tabs | difficulty | timelimit | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
quarkus-project |
yp2e1vrhohvf |
challenge |
Topic 3 - Qurkus Project Create |
|
intermediate |
1000 |
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.
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
http POST :8080/person firstName=Carlos lastName=Santana salutation=Mr
http :8080/person
http PUT :8080/person/1 firstName=Jimi lastName=Hendrix
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.