Skip to content

Configuration

SunilOS edited this page Mar 12, 2019 · 7 revisions

1) Create Table

Create Marksheet table using db.sql script

CREATE TABLE st_marksheet ( ... )

2) Configure database

Change following entries in application.properties file

spring.datasource.url = jdbc:mysql://localhost:3306/demo_ors

spring.datasource.username = root

spring.datasource.password =password

3) Run application

Start execution of your application by executing main class SOSApp.java

This class is annotated by @SpringBootApplication annotation. @SpringBootApplication makes this class spring boot start-up class.

@ComponentScan annotation is used to specify base package to spring boot to auto discover beans and register with IOC container.

By default, package of start-up class is taken as base package. Since SOSApp.class exists in com.sunilos.springboot package so by default this package is taken as base package if @ComponentScan annotation is not specified.

@SpringBootApplication

@ComponentScan(basePackages = { "com.sunilos.springboot" })

public class SOSApp {

`public static void main(String[] args) {`

	`SpringApplication.run(SOSApp.class, args);`

`}`

}

Clone this wiki locally