Skip to content

Commit d7023fd

Browse files
committed
Delete unused JdbcTemplate fields in examples
Closes gh-24085
1 parent 52a1fc4 commit d7023fd

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/docs/asciidoc/data-access.adoc

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4124,11 +4124,9 @@ example uses only one configuration method (we show examples of multiple methods
41244124
----
41254125
public class JdbcActorDao implements ActorDao {
41264126
4127-
private JdbcTemplate jdbcTemplate;
41284127
private SimpleJdbcInsert insertActor;
41294128
41304129
public void setDataSource(DataSource dataSource) {
4131-
this.jdbcTemplate = new JdbcTemplate(dataSource);
41324130
this.insertActor = new SimpleJdbcInsert(dataSource).withTableName("t_actor");
41334131
}
41344132
@@ -4148,7 +4146,6 @@ example uses only one configuration method (we show examples of multiple methods
41484146
----
41494147
class JdbcActorDao(dataSource: DataSource) : ActorDao {
41504148
4151-
private val jdbcTemplate = JdbcTemplate(dataSource)
41524149
private val insertActor = SimpleJdbcInsert(dataSource).withTableName("t_actor")
41534150
41544151
fun add(actor: Actor) {
@@ -4183,11 +4180,9 @@ listing shows how it works:
41834180
----
41844181
public class JdbcActorDao implements ActorDao {
41854182
4186-
private JdbcTemplate jdbcTemplate;
41874183
private SimpleJdbcInsert insertActor;
41884184
41894185
public void setDataSource(DataSource dataSource) {
4190-
this.jdbcTemplate = new JdbcTemplate(dataSource);
41914186
this.insertActor = new SimpleJdbcInsert(dataSource)
41924187
.withTableName("t_actor")
41934188
.usingGeneratedKeyColumns("id");
@@ -4209,7 +4204,6 @@ listing shows how it works:
42094204
----
42104205
class JdbcActorDao(dataSource: DataSource) : ActorDao {
42114206
4212-
private val jdbcTemplate = JdbcTemplate(dataSource)
42134207
private val insertActor = SimpleJdbcInsert(dataSource)
42144208
.withTableName("t_actor").usingGeneratedKeyColumns("id")
42154209
@@ -4245,11 +4239,9 @@ You can limit the columns for an insert by specifying a list of column names wit
42454239
----
42464240
public class JdbcActorDao implements ActorDao {
42474241
4248-
private JdbcTemplate jdbcTemplate;
42494242
private SimpleJdbcInsert insertActor;
42504243
42514244
public void setDataSource(DataSource dataSource) {
4252-
this.jdbcTemplate = new JdbcTemplate(dataSource);
42534245
this.insertActor = new SimpleJdbcInsert(dataSource)
42544246
.withTableName("t_actor")
42554247
.usingColumns("first_name", "last_name")
@@ -4272,7 +4264,6 @@ You can limit the columns for an insert by specifying a list of column names wit
42724264
----
42734265
class JdbcActorDao(dataSource: DataSource) : ActorDao {
42744266
4275-
private val jdbcTemplate = JdbcTemplate(dataSource)
42764267
private val insertActor = SimpleJdbcInsert(dataSource)
42774268
.withTableName("t_actor")
42784269
.usingColumns("first_name", "last_name")
@@ -4309,11 +4300,9 @@ values. The following example shows how to use `BeanPropertySqlParameterSource`:
43094300
----
43104301
public class JdbcActorDao implements ActorDao {
43114302
4312-
private JdbcTemplate jdbcTemplate;
43134303
private SimpleJdbcInsert insertActor;
43144304
43154305
public void setDataSource(DataSource dataSource) {
4316-
this.jdbcTemplate = new JdbcTemplate(dataSource);
43174306
this.insertActor = new SimpleJdbcInsert(dataSource)
43184307
.withTableName("t_actor")
43194308
.usingGeneratedKeyColumns("id");
@@ -4333,7 +4322,6 @@ values. The following example shows how to use `BeanPropertySqlParameterSource`:
43334322
----
43344323
class JdbcActorDao(dataSource: DataSource) : ActorDao {
43354324
4336-
private val jdbcTemplate = JdbcTemplate(dataSource)
43374325
private val insertActor = SimpleJdbcInsert(dataSource)
43384326
.withTableName("t_actor")
43394327
.usingGeneratedKeyColumns("id")
@@ -4356,11 +4344,9 @@ convenient `addValue` method that can be chained. The following example shows ho
43564344
----
43574345
public class JdbcActorDao implements ActorDao {
43584346
4359-
private JdbcTemplate jdbcTemplate;
43604347
private SimpleJdbcInsert insertActor;
43614348
43624349
public void setDataSource(DataSource dataSource) {
4363-
this.jdbcTemplate = new JdbcTemplate(dataSource);
43644350
this.insertActor = new SimpleJdbcInsert(dataSource)
43654351
.withTableName("t_actor")
43664352
.usingGeneratedKeyColumns("id");
@@ -4382,7 +4368,6 @@ convenient `addValue` method that can be chained. The following example shows ho
43824368
----
43834369
class JdbcActorDao(dataSource: DataSource) : ActorDao {
43844370
4385-
private val jdbcTemplate = JdbcTemplate(dataSource)
43864371
private val insertActor = SimpleJdbcInsert(dataSource)
43874372
.withTableName("t_actor")
43884373
.usingGeneratedKeyColumns("id")
@@ -4445,11 +4430,9 @@ of the stored procedure):
44454430
----
44464431
public class JdbcActorDao implements ActorDao {
44474432
4448-
private JdbcTemplate jdbcTemplate;
44494433
private SimpleJdbcCall procReadActor;
44504434
44514435
public void setDataSource(DataSource dataSource) {
4452-
this.jdbcTemplate = new JdbcTemplate(dataSource);
44534436
this.procReadActor = new SimpleJdbcCall(dataSource)
44544437
.withProcedureName("read_actor");
44554438
}
@@ -4474,7 +4457,6 @@ of the stored procedure):
44744457
----
44754458
class JdbcActorDao(dataSource: DataSource) : ActorDao {
44764459
4477-
private val jdbcTemplate = JdbcTemplate(dataSource)
44784460
private val procReadActor = SimpleJdbcCall(dataSource)
44794461
.withProcedureName("read_actor")
44804462

0 commit comments

Comments
 (0)