JDBC

Jdbc Example For Beginners

1. Introduction In this example we will learn how to use JDBC shipped with Java SE. The purpose of JDBC is to make possible interaction with any database in a generic way. This is to hide such details which are specific to the database vendor and expose a generic interface for client applications. We will see how to connect to ...

Read More »

Jdbc Named Parameters Example with Spring NamedParameterJdbcTemplate

In this example we will present the usage of Spring NamedParameterJdbcTemplate. 1. Introduction JDBC in general, acts as a communication layer between client applications and various databases hence relevant how we can utilise it. An introduction about plain JDBC is already available under the following link https://examples.javacodegeeks.com/enterprise-java/servlet/jdbc-servlet-example/#introduction. It is best reading that post as well to have a broader understanding of the topic. Table Of ...

Read More »

Spring Transaction Management Example with JDBC Example

In this article, I will show you an example of spring transaction management using JDBC. Let me first touch base on what is transaction and how spring facilitates transaction management. A transaction is a series of actions that are treated as a single unit of work. These actions should either complete in its entirety or not at all. Spring, provides ...

Read More »

Spring JdbcTemplate Example

This is a tutorial of Spring JDBC Framework. When we need to interface with databases the Spring JDBC framework provides solutions to all the low-level details, like open/close a connection, prepare and execute SQL statements, process exceptions and handle transactions. Thus, the only thing a developer must do is just define connection parameters and specify the SQL statement to be ...

Read More »

Delete records in database with JdbcTemplate

With this example we are going to demonstrate how to delete records in a database, using the JdbcTemplate class provided by the Spring Framework. The JdbcTemplate class is the central class in the JDBC core package. It simplifies the use of JDBC and helps to avoid common errors. It executes core JDBC workflow, leaving application code to provide SQL and ...

Read More »

Create Data Source for JdbcTemplate

This is an example of how to create a Datasource for the JdbcTemplate class provided by the Spring Framework. The DataSource class is a utility class that provides connection to the database. It is part of the JDBC specification and allows a container or a framework to hide connection pooling and transaction management issues from the application code. Creating a ...

Read More »

Update records in database with JdbcTemplate

In this example we shall show you how to update records in a database using the JdbcTemplate Class provided by the Spring Framework. The JdbcTemplate class is the central class in the JDBC core package. It simplifies the use of JDBC and helps to avoid common errors. It executes core JDBC workflow, leaving application code to provide SQL and extract ...

Read More »

Select records from database with JdbcTemplate

With this example we are going to demonstrate how to select records from a database using the JdbcTemplate class provided by the Spring Framework. The JdbcTemplate class is the central class in the JDBC core package. It simplifies the use of JDBC and helps to avoid common errors. It executes core JDBC workflow, leaving application code to provide SQL and ...

Read More »

Insert record in database with JdbcTemplate

This is an example of how to insert a record to the database using the JdbcTemplate class provided by the Spring Framework. The JdbcTemplate class is the central class in the JDBC core package. It simplifies the use of JDBC and helps to avoid common errors. It executes core JDBC workflow, leaving application code to provide SQL and extract results. ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns