Frameworks

JdbcTemplate

JdbcTemplate is Spring’s helper class for running SQL through JDBC. It opens and closes connections, prepares statements, loops through result sets, and handles exceptions for you. Traditional JDBC needs about 15 lines (connection, statement, result set, try/catch/finally) for one query. With JdbcTemplate it is one line: jdbcTemplate.query(sql, rowMapper, args). It also turns checked SQLExceptions into […]

JdbcTemplate Read More »

Working with Postgres Database Access with Spring Boot

DatabaseMetaData is a JDBC interface used to obtain information about the database, JDBC driver, tables, columns, and supported database features. It is obtained from a Connection object using the getMetaData() method. Using DatabaseMetaData, a Java program can dynamically inspect database information without directly querying system tables. This is useful for database administration, debugging, database migration

Working with Postgres Database Access with Spring Boot Read More »

Response Handling

Response handling is how your API answers a client: the JSON body, the HTTP status code (200, 201, 404 and so on), and the headers. Spring Boot converts a returned Java object into JSON automatically, and ResponseEntity lets you control the status code and headers as well. It is used so clients can tell success

Response Handling Read More »

Request Body

The request body is the data a client sends inside a POST or PUT request, usually as JSON. @RequestBody tells Spring to read that JSON and convert it into a Java object automatically, using the Jackson library (this is called deserialization). It is used for sending structured data such as registration forms, orders, or profile

Request Body Read More »

Query Parameters

Query parameters are key=value pairs added to the end of a URL after ? and joined with &, like /students/search?name=ravi&department=CSE. In a controller, @RequestParam reads each one and passes it into the method, converting it to the parameter’s type. They are used for optional search, filtering, sorting, and paging, where the URL still points to

Query Parameters Read More »

Path Variables

A path variable is a value written inside the URL itself, such as the 5 in /students/5. In the mapping you write a placeholder like /students/{id}, and @PathVariable captures the real value and passes it into the controller method. It is used to identify a specific resource (one student, one order, one course) in clean,

Path Variables Read More »

Request Mapping

Request mapping tells Spring which controller method should handle which request, based on the URL and the HTTP method. @RequestMapping on a class sets the base URL, and @GetMapping, @PostMapping, @PutMapping, @DeleteMapping on methods narrow it down. It is used so one URL like /api/students can do different things (read, create, update, delete) depending on

Request Mapping Read More »

Controllers

A controller is the class that receives HTTP requests from clients, decides what to do with them, and returns a response. Spring maps each URL and HTTP method (GET, POST, PUT, DELETE) to a controller method using annotations like @GetMapping and @PostMapping. It is used to keep the web layer separate: the controller only handles

Controllers Read More »

Spring MVC Basics

Spring MVC is the web framework in Spring Boot that follows the Model-View-Controller pattern: the Controller handles requests, the Model carries data, and the View renders the page. Every request first reaches the DispatcherServlet, which finds the right controller method, runs it, and then picks a view to render. It is used to build web

Spring MVC Basics Read More »

Spring Boot Web Development With MySQL

DatabaseMetaData is a JDBC interface used to obtain information about the database, JDBC driver, tables, columns, and supported database features. It is obtained from a Connection object using the getMetaData() method. Using DatabaseMetaData, a Java program can dynamically inspect database information without directly querying system tables. This is useful for database administration, debugging, database migration

Spring Boot Web Development With MySQL Read More »

Scroll to Top