增加 README.md 说明
This commit is contained in:
		| @@ -1,6 +1,6 @@ | |||||||
| # spring +druid+ mybatis(xml配置方式) | # spring +druid+ mybatis(xml配置方式) | ||||||
|  |  | ||||||
| 1、创建标准web maven工程,导入依赖 | #### 1、创建标准web maven工程,导入依赖 | ||||||
|  |  | ||||||
| ```xml | ```xml | ||||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||||
| @@ -106,7 +106,7 @@ | |||||||
| </project> | </project> | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| 2、在web.xml 进行如下配置 | #### 2、在web.xml 进行如下配置 | ||||||
|  |  | ||||||
| ```xml | ```xml | ||||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||||
| @@ -132,7 +132,7 @@ | |||||||
|         <url-pattern>/</url-pattern> |         <url-pattern>/</url-pattern> | ||||||
|     </servlet-mapping> |     </servlet-mapping> | ||||||
|  |  | ||||||
|     <!-- 配置 Druid 监控信息显示页面 访问地址 <a src="http://localhost:8080/druid/index.html"> --> |     <!-- 配置 Druid 监控信息显示页面 访问地址 <a href="http://localhost:8080/druid/index.html"> --> | ||||||
|     <servlet> |     <servlet> | ||||||
|         <servlet-name>DruidStatView</servlet-name> |         <servlet-name>DruidStatView</servlet-name> | ||||||
|         <servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class> |         <servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class> | ||||||
| @@ -175,7 +175,7 @@ | |||||||
| </web-app> | </web-app> | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| 3、在resources文件夹下新建数据库配置文件jdbc.properties | #### 3、在resources文件夹下新建数据库配置文件jdbc.properties | ||||||
|  |  | ||||||
| ```properties | ```properties | ||||||
| # mysql 数据库配置 | # mysql 数据库配置 | ||||||
| @@ -302,7 +302,7 @@ oracle.password=密码 | |||||||
| </beans> | </beans> | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| 5、新建mybtais 配置文件 更多settings配置项可以参考[官方文档](http://www.mybatis.org/mybatis-3/zh/configuration.html) | #### 5、新建mybtais 配置文件 更多settings配置项可以参考[官方文档](http://www.mybatis.org/mybatis-3/zh/configuration.html) | ||||||
|  |  | ||||||
| ```xml | ```xml | ||||||
| <?xml version="1.0" encoding="UTF-8" ?> | <?xml version="1.0" encoding="UTF-8" ?> | ||||||
| @@ -325,7 +325,7 @@ oracle.password=密码 | |||||||
|  |  | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| 6、新建查询接口及其对应的mapper文件 | #### 6、新建查询接口及其对应的mapper文件 | ||||||
|  |  | ||||||
| ```java | ```java | ||||||
| public interface MysqlDao { | public interface MysqlDao { | ||||||
| @@ -372,7 +372,7 @@ public interface OracleDao { | |||||||
| </mapper> | </mapper> | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| 7.新建测试controller进行测试 | #### 7.新建测试controller进行测试 | ||||||
|  |  | ||||||
| ```java | ```java | ||||||
| package com.heibaiying.controller; | package com.heibaiying.controller; | ||||||
| @@ -433,6 +433,6 @@ public class OracleController { | |||||||
|  |  | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| 8、druid 监控页面访问地址http://localhost:8080/druid/index.html | #### 8、druid 监控页面访问地址http://localhost:8080/druid/index.html | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user