Use consistently snippet tags
See gh-22171
This commit is contained in:
@@ -24,7 +24,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Configuration
|
||||
class BasicDataSourceConfiguration {
|
||||
|
||||
// tag::dataSourceBean[]
|
||||
// tag::snippet[]
|
||||
@Bean(destroyMethod = "close")
|
||||
BasicDataSource dataSource() {
|
||||
BasicDataSource dataSource = new BasicDataSource();
|
||||
@@ -34,6 +34,6 @@ class BasicDataSourceConfiguration {
|
||||
dataSource.setPassword("");
|
||||
return dataSource;
|
||||
}
|
||||
// end::dataSourceBean[]
|
||||
// end::snippet[]
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Configuration
|
||||
class ComboPooledDataSourceConfiguration {
|
||||
|
||||
// tag::dataSourceBean[]
|
||||
// tag::snippet[]
|
||||
@Bean(destroyMethod = "close")
|
||||
ComboPooledDataSource dataSource() throws PropertyVetoException {
|
||||
ComboPooledDataSource dataSource = new ComboPooledDataSource();
|
||||
@@ -35,6 +35,6 @@ class ComboPooledDataSourceConfiguration {
|
||||
dataSource.setPassword("");
|
||||
return dataSource;
|
||||
}
|
||||
// end::dataSourceBean[]
|
||||
// end::snippet[]
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
||||
@Configuration
|
||||
class DriverManagerDataSourceConfiguration {
|
||||
|
||||
// tag::dataSourceBean[]
|
||||
// tag::snippet[]
|
||||
@Bean
|
||||
DriverManagerDataSource dataSource() {
|
||||
DriverManagerDataSource dataSource = new DriverManagerDataSource();
|
||||
@@ -33,6 +33,6 @@ class DriverManagerDataSourceConfiguration {
|
||||
dataSource.setPassword("");
|
||||
return dataSource;
|
||||
}
|
||||
// end::dataSourceBean[]
|
||||
// end::snippet[]
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.springframework.context.annotation.Configuration
|
||||
@Configuration
|
||||
class BasicDataSourceConfiguration {
|
||||
|
||||
// tag::dataSourceBean[]
|
||||
// tag::snippet[]
|
||||
@Bean(destroyMethod = "close")
|
||||
fun dataSource() = BasicDataSource().apply {
|
||||
driverClassName = "org.hsqldb.jdbcDriver"
|
||||
@@ -15,5 +15,5 @@ class BasicDataSourceConfiguration {
|
||||
username = "sa"
|
||||
password = ""
|
||||
}
|
||||
// end::dataSourceBean[]
|
||||
// end::snippet[]
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.springframework.context.annotation.Configuration
|
||||
@Configuration
|
||||
internal class ComboPooledDataSourceConfiguration {
|
||||
|
||||
// tag::dataSourceBean[]
|
||||
// tag::snippet[]
|
||||
@Bean(destroyMethod = "close")
|
||||
fun dataSource() = ComboPooledDataSource().apply {
|
||||
driverClass = "org.hsqldb.jdbcDriver"
|
||||
@@ -15,6 +15,6 @@ internal class ComboPooledDataSourceConfiguration {
|
||||
user = "sa"
|
||||
password = ""
|
||||
}
|
||||
// end::dataSourceBean[]
|
||||
// end::snippet[]
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.jdbc.datasource.DriverManagerDataSource
|
||||
@Configuration
|
||||
class DriverManagerDataSourceConfiguration {
|
||||
|
||||
// tag::dataSourceBean[]
|
||||
// tag::snippet[]
|
||||
@Bean
|
||||
fun dataSource() = DriverManagerDataSource().apply {
|
||||
setDriverClassName("org.hsqldb.jdbcDriver")
|
||||
@@ -31,6 +31,6 @@ class DriverManagerDataSourceConfiguration {
|
||||
username = "sa"
|
||||
password = ""
|
||||
}
|
||||
// end::dataSourceBean[]
|
||||
// end::snippet[]
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:context="http://www.springframework.org/schema/context">
|
||||
|
||||
<!-- tag::dataSourceBean[] -->
|
||||
<!-- tag::snippet[] -->
|
||||
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
|
||||
<property name="driverClassName" value="${jdbc.driverClassName}"/>
|
||||
<property name="url" value="${jdbc.url}"/>
|
||||
@@ -11,5 +11,5 @@
|
||||
</bean>
|
||||
|
||||
<context:property-placeholder location="jdbc.properties"/>
|
||||
<!-- end::dataSourceBean[] -->
|
||||
<!-- end::snippet[] -->
|
||||
</beans>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:context="http://www.springframework.org/schema/context">
|
||||
|
||||
<!-- tag::dataSourceBean[] -->
|
||||
<!-- tag::snippet[] -->
|
||||
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
|
||||
<property name="driverClass" value="${jdbc.driverClassName}"/>
|
||||
<property name="jdbcUrl" value="${jdbc.url}"/>
|
||||
@@ -11,5 +11,5 @@
|
||||
</bean>
|
||||
|
||||
<context:property-placeholder location="jdbc.properties"/>
|
||||
<!-- end::dataSourceBean[] -->
|
||||
<!-- end::snippet[] -->
|
||||
</beans>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:context="http://www.springframework.org/schema/context">
|
||||
|
||||
<!-- tag::dataSourceBean[] -->
|
||||
<!-- tag::snippet[] -->
|
||||
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
|
||||
<property name="driverClassName" value="${jdbc.driverClassName}"/>
|
||||
<property name="url" value="${jdbc.url}"/>
|
||||
@@ -11,5 +11,5 @@
|
||||
</bean>
|
||||
|
||||
<context:property-placeholder location="jdbc.properties"/>
|
||||
<!-- end::dataSourceBean[] -->
|
||||
<!-- end::snippet[] -->
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user