From 9441f9c5314438de7a0da49e0adbcc51dd1c7f73 Mon Sep 17 00:00:00 2001 From: qibaoguang Date: Wed, 11 Feb 2015 00:01:49 +0800 Subject: [PATCH] Update 28.1.3. Connection to a JNDI DataSource.md --- .../28.1.3. Connection to a JNDI DataSource.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/IV. Spring Boot features/28.1.3. Connection to a JNDI DataSource.md b/IV. Spring Boot features/28.1.3. Connection to a JNDI DataSource.md index e69de29..1b85466 100644 --- a/IV. Spring Boot features/28.1.3. Connection to a JNDI DataSource.md +++ b/IV. Spring Boot features/28.1.3. Connection to a JNDI DataSource.md @@ -0,0 +1,8 @@ +### 28.1.3. 连接到一个JNDI数据库 + +如果正在将Spring Boot应用部署到一个应用服务器,你可能想要用应用服务器内建的特性来配置和管理你的DataSource,并使用JNDI访问它。 + +spring.datasource.jndi-name属性可以用来替代spring.datasource.url,spring.datasource.username和spring.datasource.password去从一个特定的JNDI路径访问DataSource。比如,下面application.properties中的片段展示了如何获取JBoss定义的DataSource: +```java +spring.datasource.jndi-name=java:jboss/datasources/customers +```