Access connection factory from DatabaseClient
This commit provides an accessor for the underlying ConnectionFactory that a DatabaseClient uses. Closes gh-25521
This commit is contained in:
@@ -55,6 +55,12 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public interface DatabaseClient extends ConnectionAccessor {
|
||||
|
||||
/**
|
||||
* Return the {@link ConnectionFactory} that this client uses.
|
||||
* @return the connection factory
|
||||
*/
|
||||
ConnectionFactory getConnectionFactory();
|
||||
|
||||
/**
|
||||
* Specify a static {@code sql} statement to run. Contract for specifying a
|
||||
* SQL call along with options leading to the execution. The SQL string can
|
||||
|
||||
@@ -85,6 +85,11 @@ class DefaultDatabaseClient implements DatabaseClient {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ConnectionFactory getConnectionFactory() {
|
||||
return this.connectionFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenericExecuteSpec sql(String sql) {
|
||||
Assert.hasText(sql, "SQL must not be null or empty");
|
||||
|
||||
Reference in New Issue
Block a user