Java project created using SpringBoot
& MariaDB
.
It consists of a basic program used to add and manage students in the database, no frontend has still been implemented.
- Student: it contains the student's atributes, getters & setters.
- StudentConfig: class used to sent the students to the command line in order to be added to our DB.
- StudentController: class used to indicate the url we should follow in order to be able to view the info on a web browser.
- StudentRepository: interface that extends from the JPA repo, which gives us the propper methods to add students to the database.
- StudentService: gives the StudentController the ability of getting students by calling the method getStudents().
- Spring Web
- Spring Data JPA
- Mariadb java client
mysql -h localhost -u root
- Create database using the following command:
create database students;
- Run our SpringBoot app.
If we want to view the databases's elements, we can do it several ways:
- Browsing: http://localhost:8080/api/v1/student 1.
- Via intellij by using the database add.
- Running the following command on our open CMD:
select * from student;
1Take into account that you can change the application's running port by modifying the following line from the /src/main/resources/application.properties
file:
spring.datasource.url=jdbc:mariadb://localhost:3306/student