diff --git a/docs/Mybatis/核心处理层/Mybatis-DataSource.md b/docs/Mybatis/核心处理层/Mybatis-DataSource.md
new file mode 100644
index 0000000..85014bb
--- /dev/null
+++ b/docs/Mybatis/核心处理层/Mybatis-DataSource.md
@@ -0,0 +1,356 @@
+# Mybatis DataSource
+- `org.apache.ibatis.datasource.DataSourceFactory`
+```java
+/**
+ * 数据源工厂
+ * @author Clinton Begin
+ */
+public interface DataSourceFactory {
+
+ /**
+ * 设置 dataSource 属性
+ * @param props
+ */
+ void setProperties(Properties props);
+
+ /**
+ * 获取 dataSource
+ * @return {@link DataSource}
+ */
+ DataSource getDataSource();
+
+}
+
+```
+
+类图如下
+
+![image-20191223081023730](/images/mybatis/image-20191223081023730.png)
+
+- `setProperties`会将下列标签放入`datasource`中
+
+```java
+
+
+
+
+
+
+```
+
+
+
+
+
+
+
+
+
+- 在`org.apache.ibatis.session.Configuration`中有配置下面三个信息
+```java
+ typeAliasRegistry.registerAlias("JNDI", JndiDataSourceFactory.class);
+ typeAliasRegistry.registerAlias("POOLED", PooledDataSourceFactory.class);
+ typeAliasRegistry.registerAlias("UNPOOLED", UnpooledDataSourceFactory.class);
+
+```
+
+
+
+
+
+
+
+
+
+## JndiDataSourceFactory
+
+```java
+/**
+ * @author Clinton Begin
+ */
+public class JndiDataSourceFactory implements DataSourceFactory {
+
+ public static final String INITIAL_CONTEXT = "initial_context";
+ public static final String DATA_SOURCE = "data_source";
+ public static final String ENV_PREFIX = "env.";
+
+ /**
+ * 直接 java 数据源
+ */
+ private DataSource dataSource;
+
+ /**
+ * 获取数据源的配置信息
+ * @param allProps
+ * @return
+ */
+ private static Properties getEnvProperties(Properties allProps) {
+ final String PREFIX = ENV_PREFIX;
+ Properties contextProperties = null;
+ for (Entry