09 janeiro 2023

Using CachedRowSet in JDBC


Understanding RowSet 
A row set contains all data from a result set, but it can be disconnected from the database. A row set may make a connection with a database and keep the connection open during its life cycle, in which case it is called connected row set. 

Understanding CachedRowSet
A CachedRowSet object is a container for rows of data that caches its rows in memory, which makes it possible to operate (scroll and update) without keeping the database connection open all the time.

A CachedRowSet object makes use of a connection to the database only briefly: while it is reading data to populate itself with rows, and again while it is committing changes to the underlying database. So the rest of the time, a CachedRowSet object is disconnected, even while its data is being modified. Hence it is called disconnected row set.




Source: codejava.net

07 dezembro 2022

Spring Security Tutorial

About: 
Spring Security is a powerful and popular framework for securing Java applications. In this video, we'll show you how to get started with Spring Security, by creating a simple authentication system using basic auth and JWT.

 

27 outubro 2022

SpringBoot - Switch between multiple databases with a custom annotation

Problem
enable multiple data sources to be connected to a single service.







SpringBoot - Write Microservice in less than 2 mins..


Pre-requisite :
  • Spring boot 2.7.0
  • Maven 3.6 +
  • Java 8 or later


Please add below dependencies in the project .
  • spring-boot-starter-web
  • spring-boot-starter-data-jpa
  • spring-boot-starter-data-rest
  • lombok
  • H2
  • spring-boot-devtools