Skip to content

Commit fb312d0

Browse files
committed
Improve Javadoc for DatabasePopulator
See gh-27008
1 parent 0e670b1 commit fb312d0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/DatabasePopulator.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,15 +35,17 @@ public interface DatabasePopulator {
3535
/**
3636
* Populate, initialize, or clean up the database using the provided JDBC
3737
* connection.
38+
* <p><strong>Warning</strong>: Concrete implementations should not close
39+
* the provided {@link Connection}.
3840
* <p>Concrete implementations <em>may</em> throw an {@link SQLException} if
3941
* an error is encountered but are <em>strongly encouraged</em> to throw a
4042
* specific {@link ScriptException} instead. For example, Spring's
4143
* {@link ResourceDatabasePopulator} and {@link DatabasePopulatorUtils} wrap
4244
* all {@code SQLExceptions} in {@code ScriptExceptions}.
43-
* @param connection the JDBC connection to use to populate the db; already
44-
* configured and ready to use; never {@code null}
45+
* @param connection the JDBC connection to use; already configured and
46+
* ready to use; never {@code null}
4547
* @throws SQLException if an unrecoverable data access exception occurs
46-
* during database population
48+
* while interacting with the database
4749
* @throws ScriptException in all other error cases
4850
* @see DatabasePopulatorUtils#execute
4951
*/

0 commit comments

Comments
 (0)