Category: Spring Boot

Spring Boot

Spring embedded database examples 0

Spring embedded database examples

Let us see how to configure the embedded database engines like HSQL, H2 and Derby in Spring framework. Technologies used : Spring 4.1.6.RELEASE jUnit 4.1.2 Gradle Embedded databases used : HSQLDB 2.3.2 H2 1.4.187...

Spring Boot Multiple Embedded HSQL Database Configuration using gradle 0

Spring Boot Multiple Embedded HSQL Database Configuration using gradle

There are many situations where we require to fetch data from multiple databases and while using JPA sometimes it becomes challenging to create connections with multiple databases through a single application. Hence, in this...

How to get a reference to currently active dataSource in Spring Boot 0

How to get a reference to currently active dataSource in Spring Boot

Defining DataSource in Spring package com.javaskool.config; import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.Properties; import java.util.stream.Collectors; import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; //import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;...

Spring Boot Multiple Database Configuration using gradle 0

Spring Boot Multiple Database Configuration using gradle

There are many situations where we require to fetch data from multiple databases and while using JPA sometimes it becomes challenging to create connections with multiple databases through a single application. Hence, in this...

Database Initialization in Spring Boot 0

Database Initialization in Spring Boot

An SQL database can be initialized in different ways depending on what your stack is. Of course, you can also do it manually, provided the database is a separate process. Initialize a Database Using...

How to load Initial Data with Spring Boot 0

How to load Initial Data with Spring Boot

Spring Boot makes it really easy to manage our database changes in an easy way. If we leave the default configuration, it’ll search for entities in our packages and create the respective tables automatically....

Building an Application with Spring Boot 0

Building an Application with Spring Boot

Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can “just run”. If you want to create your own Spring Boot-based project, visit Spring Initializr, fill in your project...