/StudentProject

Spring-boot app used to store students on a local database.

Primary LanguageJava

StudentProject

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.

Project Structure

  • 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().

Dependencies used:

  • Spring Web
  • Spring Data JPA
  • Mariadb java client

Running instructions

  1. Start MariaDB, I personaly use XAMPP.
    xampp

  2. Open a command prompt and type the following command:

mysql -h localhost -u root
  1. Create database using the following command:
create database students;
  1. Run our SpringBoot app.

If we want to view the databases's elements, we can do it several ways:

select * from student;

dataBase

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