<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=quaff" rel="nofollow">Yanming Zhou</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3559?redirect=false" rel="nofollow">SPR-3559</a></strong> and commented</p>
<p dir="auto">public String parseStringValue(String placeholder)</p>
<p dir="auto">developer can reuse placeholder programmatically not only in xml configuration,for example,when  use spring-javaconfig</p>
<p dir="auto"><code class="notranslate">@Configuration</code>(defaultAutowire = Autowire.BY_NAME)<br>
public abstract class Config {</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@ExternalBean
public abstract PropertyPlaceholderConfigurer propertyPlaceholderConfigurer();

@Bean(destroyMethodName = &quot;close&quot;)
public DataSource dataSource() {
	BasicDataSource ds = new BasicDataSource();
	ds.setUrl(propertyPlaceholderConfigurer().parseStringValue(&quot;${jdbc.url}&quot;)));
	ds.setUsername(propertyPlaceholderConfigurer().parseStringValue(&quot;${jdbc.username}&quot;));
	ds.setPassword(propertyPlaceholderConfigurer().parseStringValue(&quot;${jdbc.password}&quot;));
	ds.setDriverClassName(propertyPlaceholderConfigurer().parseStringValue(&quot;${jdbc.driverClassName}&quot;));
	ds.setPoolPreparedStatements(true);
	return ds;
}"><pre class="notranslate"><code class="notranslate">@ExternalBean
public abstract PropertyPlaceholderConfigurer propertyPlaceholderConfigurer();

@Bean(destroyMethodName = "close")
public DataSource dataSource() {
	BasicDataSource ds = new BasicDataSource();
	ds.setUrl(propertyPlaceholderConfigurer().parseStringValue("${jdbc.url}")));
	ds.setUsername(propertyPlaceholderConfigurer().parseStringValue("${jdbc.username}"));
	ds.setPassword(propertyPlaceholderConfigurer().parseStringValue("${jdbc.password}"));
	ds.setDriverClassName(propertyPlaceholderConfigurer().parseStringValue("${jdbc.driverClassName}"));
	ds.setPoolPreparedStatements(true);
	return ds;
}
</code></pre></div>
<p dir="auto">}</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.1 M2</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/12642/PropertyPlaceholderConfigurer.java" rel="nofollow">PropertyPlaceholderConfigurer.java</a> (<em>17.12 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/12643/PropertyResourceConfigurer.java" rel="nofollow">PropertyResourceConfigurer.java</a> (<em>4.85 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398104955" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11823" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11823/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11823">#11823</a> Need a way to ask PropertyPlaceholderConfigurer to resolve a placeholder string (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=vmonier" rel="nofollow">Vincent MONIER</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8884?redirect=false" rel="nofollow">SPR-8884</a></strong> and commented</p>
<p dir="auto">For testing purpose, I use EmbeddedDatabase.</p>
<p dir="auto">My database schema contains HSQLDB PMS stored procedures.</p>
<p dir="auto">like this one:</p>
<p dir="auto">-----------   content of procedure.sql (a valid HSQLDB PMS stored procedure) ---------------------<br>
CREATE PROCEDURE get_customer(IN id INT, OUT firstname VARCHAR(50), OUT lastname VARCHAR(50))<br>
READS SQL DATA<br>
BEGIN ATOMIC<br>
SELECT first_name, last_name INTO firstname, lastname FROM customers WHERE cust_id = id;<br>
END</p>
<p dir="auto">When I create database instance:</p>
<p dir="auto">EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();<br>
database = builder.setType(EmbeddedDatabaseType.HSQL).addScript("classpath:/META-INF/sql/schema.sql")<br>
.addScript("classpath:/META-INF/sql/procedure.sql")<br>
.build();</p>
<p dir="auto">I get this exception:<br>
"an error occurs during parsing of procedure.sql<br>
org.hsqldb.HsqlException: unexpected end of statement:  required: ; "</p>
<p dir="auto">The problem is not in HSQLDB part but is located in :<br>
org.springframework.jdbc.datasource.init.ResourceDatabasePopulator#splitSqlScript(String script, char delim, List&lt;String&gt; statements)<br>
it uses ';' character as a delimiter for statements and therefore creates 2 statements, one for [CREATE PROCEDURE .... cust_id = id] and the second for [END].<br>
The first statement is rejected by HSQLDB because of a missing ';' character in BEGIN block.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.6</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398115368" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13459" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13459/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13459">#13459</a> Support per-script statement separator configuration for SQL scripts (<em><strong>"duplicates"</strong></em>)</li>
</ul>