From fb312d0ed5d55752df5755be29833023e5a21258 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 28 Jan 2022 16:40:35 +0100 Subject: [PATCH] Improve Javadoc for DatabasePopulator See gh-27008 --- .../jdbc/datasource/init/DatabasePopulator.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/DatabasePopulator.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/DatabasePopulator.java index 45262b8025..70e0083fb3 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/DatabasePopulator.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/DatabasePopulator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,15 +35,17 @@ public interface DatabasePopulator { /** * Populate, initialize, or clean up the database using the provided JDBC * connection. + *

Warning: Concrete implementations should not close + * the provided {@link Connection}. *

Concrete implementations may throw an {@link SQLException} if * an error is encountered but are strongly encouraged to throw a * specific {@link ScriptException} instead. For example, Spring's * {@link ResourceDatabasePopulator} and {@link DatabasePopulatorUtils} wrap * all {@code SQLExceptions} in {@code ScriptExceptions}. - * @param connection the JDBC connection to use to populate the db; already - * configured and ready to use; never {@code null} + * @param connection the JDBC connection to use; already configured and + * ready to use; never {@code null} * @throws SQLException if an unrecoverable data access exception occurs - * during database population + * while interacting with the database * @throws ScriptException in all other error cases * @see DatabasePopulatorUtils#execute */