Example #1 Wiring JDBC Datasource
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
@Configuration @ImportResource("application.yml" |
Example #1 Wiring JDBC Datasource
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
@Configuration @ImportResource("application.yml" |
conf/db.properties
# jdbc.X
jdbc.driverClassName=org.hsqldb.jdbcDriver
jdbc.url=jdbc:hsqldb:hsql://localhost/mytestdb
jdbc.user=SA
jdbc.pass=
# hibernate.X
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.show_sql=false
hibernate.hbm2ddl.auto=
#1. Register a Properties File in Application Context XML
The “<property-placeholder>” tag.
1 |
<context:property-placeholder location="classpath:conf/db.properties" /> |
OR
1 2 3 4 5 6 7 8 |
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" |
This extedns configuring JDBC and JPA to configure the TransactionManager.
Example #1 Wiring JDBC Transaction Manager
Note: @EnableTransactionManagement annotation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
@Configuration @ImportResource("application.yml" |
Example #1 Wiring JDBC Datasource
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
@Configuration @ImportResource("application.yml" |
Step 1: Define the messaging system connectivity, destination (e.g. topic or queue) and message selector properties via a YAML or .properties file. Here is an example of application.yml file.