Skip to content

danielfleming/spring-boot-mvc-reference-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-mvc-reference-app

Reference application for a Spring MVC app running in Spring Boot

In order to run the application you will need to setup the database. Use the following instructions:

  • Create a new database named "testdb"

  • Run the following script to setup the tables and sequences

DROP SCHEMA IF EXISTS testdb cascade; 
CREATE SCHEMA testdb; 
ALTER SCHEMA testdb OWNER TO testdb;

CREATE SEQUENCE testdb.customer_id_seq;

CREATE TABLE testdb.customers ( customer_id BIGINT NOT NULL DEFAULT nextval('testdb.customer_id_seq'), 
	first_name VARCHAR NOT NULL, 
	last_name VARCHAR NOT NULL, 
	address VARCHAR NOT NULL, 
	city VARCHAR NOT NULL,
	state VARCHAR NOT NULL,
	postal_code VARCHAR NOT NULL,
	phone_number VARCHAR NOT NULL,
	CONSTRAINT customers_pk PRIMARY KEY (customer_id) );

ALTER SEQUENCE testdb.customer_id_seq OWNED BY testdb.customers.customer_id;

INSERT INTO testdb.customers VALUES(nextval('testdb.customer_id_seq'), 'John', 'Smith', '1212 Main Street', 'Los Angeles', 'CA', '90210', '205-555-1212');
  • Once you have created your database then modify /src/main/resources/application.properties and set your connection parameters

  • Run the src/main/java/org/domain/Application class to run the program in Spring Boot

  • Navigate your browser to http://localhost:8080/customers

About

Reference application for a Spring MVC app running in Spring Boot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published