@@ -4124,11 +4124,9 @@ example uses only one configuration method (we show examples of multiple methods
4124
4124
----
4125
4125
public class JdbcActorDao implements ActorDao {
4126
4126
4127
- private JdbcTemplate jdbcTemplate;
4128
4127
private SimpleJdbcInsert insertActor;
4129
4128
4130
4129
public void setDataSource(DataSource dataSource) {
4131
- this.jdbcTemplate = new JdbcTemplate(dataSource);
4132
4130
this.insertActor = new SimpleJdbcInsert(dataSource).withTableName("t_actor");
4133
4131
}
4134
4132
@@ -4148,7 +4146,6 @@ example uses only one configuration method (we show examples of multiple methods
4148
4146
----
4149
4147
class JdbcActorDao(dataSource: DataSource) : ActorDao {
4150
4148
4151
- private val jdbcTemplate = JdbcTemplate(dataSource)
4152
4149
private val insertActor = SimpleJdbcInsert(dataSource).withTableName("t_actor")
4153
4150
4154
4151
fun add(actor: Actor) {
@@ -4183,11 +4180,9 @@ listing shows how it works:
4183
4180
----
4184
4181
public class JdbcActorDao implements ActorDao {
4185
4182
4186
- private JdbcTemplate jdbcTemplate;
4187
4183
private SimpleJdbcInsert insertActor;
4188
4184
4189
4185
public void setDataSource(DataSource dataSource) {
4190
- this.jdbcTemplate = new JdbcTemplate(dataSource);
4191
4186
this.insertActor = new SimpleJdbcInsert(dataSource)
4192
4187
.withTableName("t_actor")
4193
4188
.usingGeneratedKeyColumns("id");
@@ -4209,7 +4204,6 @@ listing shows how it works:
4209
4204
----
4210
4205
class JdbcActorDao(dataSource: DataSource) : ActorDao {
4211
4206
4212
- private val jdbcTemplate = JdbcTemplate(dataSource)
4213
4207
private val insertActor = SimpleJdbcInsert(dataSource)
4214
4208
.withTableName("t_actor").usingGeneratedKeyColumns("id")
4215
4209
@@ -4245,11 +4239,9 @@ You can limit the columns for an insert by specifying a list of column names wit
4245
4239
----
4246
4240
public class JdbcActorDao implements ActorDao {
4247
4241
4248
- private JdbcTemplate jdbcTemplate;
4249
4242
private SimpleJdbcInsert insertActor;
4250
4243
4251
4244
public void setDataSource(DataSource dataSource) {
4252
- this.jdbcTemplate = new JdbcTemplate(dataSource);
4253
4245
this.insertActor = new SimpleJdbcInsert(dataSource)
4254
4246
.withTableName("t_actor")
4255
4247
.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
4272
4264
----
4273
4265
class JdbcActorDao(dataSource: DataSource) : ActorDao {
4274
4266
4275
- private val jdbcTemplate = JdbcTemplate(dataSource)
4276
4267
private val insertActor = SimpleJdbcInsert(dataSource)
4277
4268
.withTableName("t_actor")
4278
4269
.usingColumns("first_name", "last_name")
@@ -4309,11 +4300,9 @@ values. The following example shows how to use `BeanPropertySqlParameterSource`:
4309
4300
----
4310
4301
public class JdbcActorDao implements ActorDao {
4311
4302
4312
- private JdbcTemplate jdbcTemplate;
4313
4303
private SimpleJdbcInsert insertActor;
4314
4304
4315
4305
public void setDataSource(DataSource dataSource) {
4316
- this.jdbcTemplate = new JdbcTemplate(dataSource);
4317
4306
this.insertActor = new SimpleJdbcInsert(dataSource)
4318
4307
.withTableName("t_actor")
4319
4308
.usingGeneratedKeyColumns("id");
@@ -4333,7 +4322,6 @@ values. The following example shows how to use `BeanPropertySqlParameterSource`:
4333
4322
----
4334
4323
class JdbcActorDao(dataSource: DataSource) : ActorDao {
4335
4324
4336
- private val jdbcTemplate = JdbcTemplate(dataSource)
4337
4325
private val insertActor = SimpleJdbcInsert(dataSource)
4338
4326
.withTableName("t_actor")
4339
4327
.usingGeneratedKeyColumns("id")
@@ -4356,11 +4344,9 @@ convenient `addValue` method that can be chained. The following example shows ho
4356
4344
----
4357
4345
public class JdbcActorDao implements ActorDao {
4358
4346
4359
- private JdbcTemplate jdbcTemplate;
4360
4347
private SimpleJdbcInsert insertActor;
4361
4348
4362
4349
public void setDataSource(DataSource dataSource) {
4363
- this.jdbcTemplate = new JdbcTemplate(dataSource);
4364
4350
this.insertActor = new SimpleJdbcInsert(dataSource)
4365
4351
.withTableName("t_actor")
4366
4352
.usingGeneratedKeyColumns("id");
@@ -4382,7 +4368,6 @@ convenient `addValue` method that can be chained. The following example shows ho
4382
4368
----
4383
4369
class JdbcActorDao(dataSource: DataSource) : ActorDao {
4384
4370
4385
- private val jdbcTemplate = JdbcTemplate(dataSource)
4386
4371
private val insertActor = SimpleJdbcInsert(dataSource)
4387
4372
.withTableName("t_actor")
4388
4373
.usingGeneratedKeyColumns("id")
@@ -4445,11 +4430,9 @@ of the stored procedure):
4445
4430
----
4446
4431
public class JdbcActorDao implements ActorDao {
4447
4432
4448
- private JdbcTemplate jdbcTemplate;
4449
4433
private SimpleJdbcCall procReadActor;
4450
4434
4451
4435
public void setDataSource(DataSource dataSource) {
4452
- this.jdbcTemplate = new JdbcTemplate(dataSource);
4453
4436
this.procReadActor = new SimpleJdbcCall(dataSource)
4454
4437
.withProcedureName("read_actor");
4455
4438
}
@@ -4474,7 +4457,6 @@ of the stored procedure):
4474
4457
----
4475
4458
class JdbcActorDao(dataSource: DataSource) : ActorDao {
4476
4459
4477
- private val jdbcTemplate = JdbcTemplate(dataSource)
4478
4460
private val procReadActor = SimpleJdbcCall(dataSource)
4479
4461
.withProcedureName("read_actor")
4480
4462
0 commit comments