Skip to content

isanuric/rest-mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MySQL

Creation

$ mysql -u root -p

use your password and adjust it in Spring Boot application.properties

mysql> CREATE DATABASE book_database;

mysql> USE book_database;

mysql> CREATE TABLE book
(
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(60) NOT NULL,
autor varchar(100) NOT NULL,
iban int(30) NOT NULL,
status int (10) NOT NULL DEFAULT 1,
timestamp TIMESTAMP,
PRIMARY KEY (id)
);

Make some test data

mysql> INSERT INTO BOOK (id,name,autor,iban) VALUES(1,"Grundriss Heidegger","Helmuth Vetter", 9783);

more data …​

Check Table

mysql> SELECT * FROM book

you should see something like this:

bookId name autor iban …​

1

Grundriss Heidegger

Helmuth Vetter

9783

..

2

…​

..

..

..

Quick Start

  • mvn clean install

  • build project

Smoke Test: CRUD operations

Create (POST): $ curl --data "name=testPost&autor=authPost&iban=1235" http://localhost:8080/books/add

Delete by id: curl -X DELETE http://localhost:8080/books/delete/1

About

A REST-API sample with Spring Boot and MySql.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages