1).Why Spring Boot?
Removing XML and provide Annotations
Standardization for Microservices
Integrated Server for Development
Cloud Support
Adapt & Support for 3rd Party Library
2).What is Spring Boot?
Spring Boot=Spring framework-XML Configuration+Integrated Server
3).What is parent class in SpringBoot Application?
Spring-boot-starter-parent
4).Examples of in built databases
Apache Derby
H2 DB
HSQLDB
5).What is CommandLineRunner
To start our application without main method
6).what is @SpringBootApplication?
Starting point of Spring Boot Application
7).Waht is Sping Data JPA?
It is a part of Spring Data Family,aims to provide JPA basedd repositories that aims to simplify the
implementation of data access layer using JPA.
8).what are sub interfaces in Repository Interface
CrudRepository
PagingAndSortingRepository
JpaRepository
9).What is difference between JPARepository and CrudRepository?
->Identify Repository DAO
10).how to create Custom queries?
Creating queries using methodnames
@Query
@NamedQuery
11).How to create Jar/war in spring Boot
by configuring spring-boot-maven-plugin in [Link] file
-->ConfigurationApplicationContext applicationContext=
[Link]([Link],args);
[Link]("userDefinedClass",[Link]);
12).@Modifing(clearAutomatically=true) Annotation?
EntityManager need to flush all the changes into DB we need to configure @Modifing
13).What is Actuator?
If we need to know about our application properties like loggers,endpoints we need to add
spring-boot-starter-actuator jar in pom file
we can access info,health from browser.
[Link]
We have 2 types of actuators
[Link] and Insensitive
We we need to access sensitive info we need to add below property in [Link] file
[Link]=false
14).How to Change actuator port number?
[Link]=9999
15).what is spring-boot-starter-security
if we need to access sensitive information with username and passwords we need to
configure this in pom file
[Link]=true
[Link]=true
[Link]=admin
[Link]=root
16).why we need Spring-boot-devtools?
If we modified any changes in code,If we want to restart automatically we need to add spring-
[Link] in [Link]
17).How to configure Loggers in Spring boot?
Spring Boot have inbuilt Logger support
private static final Logger
in properties file,we can customize loggers
[Link]=debug;
[Link]=logs
18).what is Profiles?
Profiles are used to do configuration based on environment wise in [Link] file
eg:-
[Link]
[Link]
[Link]
eg:
@service
@Profile("dev")
class DevProfileBean implements EnvBasedCofig{
@Override
public void setup(){ }
}
[Link]=prod
19).what is CommandLineRunner Interface and ApplicationRunner Interface?
Both of them provides the same functionality and the only difference between
CommandLineRunner and ApplicationRunner is [Link]() accepts String
array[] whereas [Link]() accepts ApplicationArguments as argument.
20).How to set Default Properties in Spring Boot?
Map<String,Object> configMap=new HashMap<>();
[Link]("SERVER_PORT",8565);
[Link](configMap);
21).How to change Context path?
[Link]-path=/SpringApplication
22).How to change Banner?
[Link]=classpath:[Link]
23).What is Thymeleaf?
Thymeleaf is a serverside template,if we need to run html,xml,css,java we can use.
24).csrf
CrossSiteRequestForgery
25).What is inMemoryAuthenticaltion?
It is a Basic Autthentication.
@EnableWebSecurity
public class Security extends WebSecurityConfigurerAdapter{
@Override
protected void configure(HttpSecurity http) throws Exception {
[Link]().disable().authorizeRequests().
antMatchers("/hello/**").hasRole("user").and().formLogin();
[Link]().disable().authorizeRequests().
antMatchers("/morning/**").hasRole("admin").and().formLogin();
@Autowired
public void configureGlobal(AuthenticationManagerBuilder builder) throws
Exception{
[Link]().withUser("admin").password("admin").roles("us
er","admin");
[Link]().withUser("user").password("user").roles("user
");
26).How to enable Security?
using @EnableWebSecurity annotation and extends
WebSecurityConfigurerAdapter class
27).How to enable Method level Security?
using @EnableGlobalMethodSecurity(securedEnable=true)
28).What is @EnableBatchProcessing?
To enable Spring Batch application we need to configure this annotation.
In Configuration file we need to add
[Link]=true;
29).What is Flyway database?
It is OpenSource DB
[Link]=true;
[Link]="schema location"
30).what is liquibasedb?
Liquibasedb is used to store logs in db.
below table will create when we use LiquibaseDB
databasechanelog
databasechaneloglock
31).Flyway vs LiquiBase?
our project is small go for FlyWay
In our project we are using more than one database go for Liquibase
32).what is HikariCP Connection Pool?
It is a connection [Link] of DBCP,we can use this.