Commit b0dab278 authored by 高洋's avatar 高洋

Updates 后端开发/database-config.md

Auto commit by GitBook Editor
parent 84a98b5b
......@@ -4,20 +4,20 @@
##配置文件
1. 数据源配置
* hap 默认使用 JNDI 来配置数据源。数据源的配置独立于项目配置
* 默认使用的 JNDI name 为 `jdbc/hap_dev`
* 融租易默认使用 JNDI 来配置数据源。数据源的配置独立于项目配置
* 默认使用的 JNDI name 为 `jdbc/hel_dev`
* tomcat 需要配置 context.xml:
- Mysql
```xml
<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/hap_dev" name="jdbc/hap_dev" type="javax.sql.DataSource" username="hap_dev" password="hap_dev"/>
```
<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/hel" name="jdbc/hel_dev" type="javax.sql.DataSource" username="hel_dev" password="hel_dev"/>
```
- Oracle
```xml
<Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver" name="jdbc/hap_dev" type="javax.sql.DataSource" url="jdbc:oracle:thin:@192.168.115.136:1521:HAP" username="hap_dev" password="hap_dev"/>
```
<Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver" name="jdbc/hel_dev" type="javax.sql.DataSource" url="jdbc:oracle:thin:@127.0.0.1:1521:hel" username="hel_dev" password="hel_dev"/>
```
- SqlServer
```xml
<Resource auth="Container" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://10.211.55.6:1433; DatabaseName=hap_dev" name="jdbc/hap_dev" type="javax.sql.DataSource" username="hap" password="handhapdev"/>
```
<Resource auth="Container" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://127.0.0.1:1433; DatabaseName=hel" name="jdbc/hel_dev" type="javax.sql.DataSource" username="hel_dev" password="hel_dev"/>
```
* 其他应用服务器 weblogic 等,需要按其配置方法 配置 JNDI
......
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