Tag: database

  • How to connect to database using ConnectionDetails interface in Spring Boot?

    Let’s say you want to connect to a database in your Spring Boot application. You first add Spring Data dependency. Then to configure the database details , you had two options: Starting Spring Boot 3.1.1 you have one more option. Using ConnectionDetails interface. Let’s see how to do that with an example. STEP 1: Add…

  • How to create a Database and perform CRUD operations in MongoDB through command prompt?

    MongoDB is one of the most popular NoSQL databases . Instead of inserting rows into tables as in traditional relational databases you insert documents into collections in a MongoDB. The documents have the structure of a JSON. And the documents dont have to have a defined structure as tables need to in a relational database.…

  • How to write recursive queries in SQL?

    Let’s say you want to find out all the subordinates to a manager recursively. That is say Kiran reports to Guru and Gayathri reports to Kiran , then the subordinates of Guru are both Kiran and Gayathri. This can be done using recursive queries. Let’s see how to do it in PostgreSQL. This is supported…