JdbcTemplate: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 7: Line 7:


Basic persistence with [[JDBC]] is supported by the [[Spring Framework]] with JdbcTemplate. JdbcTemplate provides the means by which developers can perform [[SQL]] operations against a relational database without the need to retort to verbose JDBC low-level API. With JdbcTemplate, the interaction with the database is reduced to specifying the query and how to map the result of the query to the domain model object.
Basic persistence with [[JDBC]] is supported by the [[Spring Framework]] with JdbcTemplate. JdbcTemplate provides the means by which developers can perform [[SQL]] operations against a relational database without the need to retort to verbose JDBC low-level API. With JdbcTemplate, the interaction with the database is reduced to specifying the query and how to map the result of the query to the domain model object.
=Spring Persistence Concepts=
{{Internal|Spring_Persistence_Concepts#Overview|Spring Persistence Concepts}}


=Spring Boot Support=
=Spring Boot Support=

Revision as of 20:28, 14 October 2018

Internal

Overview

Basic persistence with JDBC is supported by the Spring Framework with JdbcTemplate. JdbcTemplate provides the means by which developers can perform SQL operations against a relational database without the need to retort to verbose JDBC low-level API. With JdbcTemplate, the interaction with the database is reduced to specifying the query and how to map the result of the query to the domain model object.

Spring Persistence Concepts

Spring Persistence Concepts

Spring Boot Support

To add support for JdbcTemplate to a Spring Boot project, add the following starter dependency:

dependencies {
    implementation('org.springframework.boot:spring-boot-starter-jdbc')
}

JdbcTemplate needs a database to work with. This is how to add H2 support:

dependencies {
    runtimeOnly('com.h2database:h2')
}

Reading Data

Writing Data