Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ private void runScripts(List<Resource> resources, String username, String passwo
ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
populator.setContinueOnError(this.properties.isContinueOnError());
populator.setSeparator(this.properties.getSeparator());
populator.setCommentPrefix(this.properties.getCommentPrefix());
if (this.properties.getSqlScriptEncoding() != null) {
populator.setSqlScriptEncoding(this.properties.getSqlScriptEncoding().name());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import javax.sql.DataSource;

import org.springframework.jdbc.datasource.init.ScriptUtils;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.InitializingBean;
Expand Down Expand Up @@ -143,6 +144,11 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
* Statement separator in SQL initialization scripts.
*/
private String separator = ";";

/**
* Prefix that identifies single-line comments within the SQL scripts.
*/
private String commentPrefix = ScriptUtils.DEFAULT_COMMENT_PREFIX;

/**
* SQL scripts encoding.
Expand Down Expand Up @@ -457,6 +463,14 @@ public String getSeparator() {
public void setSeparator(String separator) {
this.separator = separator;
}

public String getCommentPrefix() {
return this.commentPrefix;
}

public void setCommentPrefix(String commentPrefix) {
this.commentPrefix = commentPrefix;
}

public Charset getSqlScriptEncoding() {
return this.sqlScriptEncoding;
Expand Down