Commit 7ceca4d8 authored by Stephane Nicoll's avatar Stephane Nicoll

Document how to configure a JNDI data source

Closes gh-4023
parent d46c9a28
......@@ -1437,6 +1437,21 @@ See _<<spring-boot-features.adoc#boot-features-configure-datasource>>_ in the
{sc-spring-boot-autoconfigure}/jdbc/DataSourceAutoConfiguration.{sc-ext}[`DataSourceAutoConfiguration`]
class for more details.
[TIP]
====
You could also do that if you want to configure a JNDI data-source.
[source,java,indent=0,subs="verbatim,quotes,attributes"]
----
@Bean(destroyMethod="")
@ConfigurationProperties(prefix="datasource.mine")
public DataSource dataSource() throws Exception {
JndiDataSourceLookup dataSourceLookup = new JndiDataSourceLookup();
return dataSourceLookup.getDataSource("java:comp/env/jdbc/YourDS");
}
----
====
[[howto-two-datasources]]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment