ConcurrentHashMap is a class introduced in Java 1.5 Version which implements the ConcurrentMap interface. The ConcurrentHashMap is simply a concurrent version of the HashMap, the functionality is also similar to that of a HashMap except for the internal concurrency. In this article, we will get to know what is Java ConcurrentHashMap and it's usage, along with it we will also … [Read more...]
Difference between new operator vs newInstance() method in Java
In this article, we will learn the difference between new operator vs newInstance() method. In general, the new operator is used to create the object if you know the type of the object at the beginning itself, but if you don't know the type of the object at the beginning and if it is passed at the Runtime then we need to go with newInstance() method. … [Read more...]
Spring Boot JPA One To One Example with MySQL | Unidirectional & Bidirectional
In this article, we will learn how to create a Spring Boot JPA One To One mapping using Spring Data JPA with Foreign Key. In this approach, we will have two tables with different primary keys. The primary key of the STUDENT table (ID) will act as a foreign key for the PASSPORT table and PASSPORT table will have its own primary key (ID). … [Read more...]
Spring Security – Custom UserDetailsService Example | InMemory & Database Authentication
Previously we have learned about InMemoryUserDetailManager and JdbcUserDetailsManager. UserDetailsService is the core interface which is responsible for providing the User information to the AuthenticationManager. In this article, we will create a Custom UserDetailsService retrieves the user details from both InMemory and JDBC. … [Read more...]
5 Different Prime Number Program in Java | Prime Numbers between 1 to 100
What is a Prime Number? A Prime Number is a number which is greater than 1 and divisible by 1 and only itself. Some of the Prime Numbers are 2, 3, 5, 7, 11, 13, 17... In this Prime Number Program in Java, let's take a look into the different prime number programs. … [Read more...]
2 Different Magic Number in Java | Check whether a number is Magic Number or Not?
Before looking at the Magic number in Java, let's gets some basic understanding on a Magic number What is a Magic Number? A Magic Number is a text or numeric value which is used in the code which is used for some identification. Using such constant can help us distinguish the files among the many other file formats. … [Read more...]
Spring Security – JdbcUserDetailsManager Example | JDBC Authentication and Authorization
In the previous article, we have learned about Spring InMemoryUserDetailsManager which internally stores and retrieves the user-related information, Spring Security's JdbcUserDetailsManager class uses the database to store and retrieve the user information. In this JdbcUserDetailsManager Example, we perform Create, Read, Update, and Delete (CRUD) operations on the user details … [Read more...]
Armstrong Number in Java | Print Armstrong Number between 1 to 1000
An Armstrong Number is a number which is equal to the sum of its owns digits, each of them raised to the power of the total number of digits. In this article, Let's write a program check whether the given number is Armstrong Number in Java. … [Read more...]
Spring Security – InMemoryUserDetailsManager Example | In-Memory Authentication
Spring In-Memory authentication uses InMemoryUserDetailsManager internally store and retrieve the user-related information which is required for Authentication. In this InMemoryUserDetailsManager Example, we will learn how to create and store the user to the in-memory HashMap, update the user credentials and finally delete the User. … [Read more...]
Spring Data MongoDB Example – MongoRepository
In this Spring Data MongoDB Example, we will build a Simple Spring Application and perform CRUD operations on the Mongo Database with the help of Spring Data MongoDB and MongoRepository. MongoDB is a document-based NoSQL database, providing high performance and high availability. Spring provides seamless integration with the Mongo database through Spring Data MongoDB which is a … [Read more...]
Spring Data REST Example – Spring Boot RESTful API + CRUD
Spring Data REST is built on top of the Spring Data repositories and it automatically exposes the repositories as REST services. Spring Data REST takes the features of Spring HATEOAS and Spring Data JPA and combines them together, using a Strategy called "RepositoryDetectionStrategy" to export the repository as a REST resource. In this Spring Data REST Example, let's create a … [Read more...]
Spring Boot MVC | Spring Boot JSP Example
In this article, we will learn how to create a Spring Boot MVC application, which is simply a Spring MVC application using Spring Boot. Unlike a typical Spring Boot application, we will be rendering the JSP page to the user. Let's get started. … [Read more...]
- « Previous Page
- 1
- 2
- 3
- 4
- 5
- …
- 31
- Next Page »