首页

sharding-jdbc分库分表完整(含依赖包&数据脚本)项目示例下载

标签:sharding-jdbc,分库分表,mycat,代码映射     发布时间:2019-05-26   
  • 云盘下载:
  • [提取码:jxfn]
  • 本地下载:
       ( 需积分:2  )

一、项目说明

本项目是sharding-jdbc用做代码中间层分库分表框架,借助于它不需要安装配置MyCat(不需要动代码,修改配置可以实现分库分表),实现逻辑实现MySql数据库的分库分表,项目其中ShardingJdbcMybatisTest类为junit测试入口(注意映入junit-4.12.jar依赖包,低版本的和项目pom.xml中spring 4.1.4.RELEASE不匹配)、sharding_1.sql数据脚本,项目结构如下所示i

sharding-jdbc分库分表完整(含依赖包&数据脚本)项目示例下载

二、代码示例

运行ShardingJdbcMybatisTest测试

import java.util.Arrays;@b@import java.util.List;@b@@b@import javax.annotation.Resource;@b@@b@import org.junit.AfterClass;@b@import org.junit.Assert;@b@import org.junit.Before;@b@import org.junit.BeforeClass;@b@import org.junit.Test;@b@import org.junit.runner.RunWith;@b@import org.springframework.beans.factory.annotation.Autowired;@b@import org.springframework.test.context.ContextConfiguration;@b@import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;@b@import org.springframework.test.context.transaction.BeforeTransaction;@b@@b@import com.lyz.sharding.entity.Student;@b@import com.lyz.sharding.entity.User;@b@import com.lyz.sharding.service.StudentService;@b@import com.lyz.sharding.service.UserService;@b@@b@@b@@RunWith(SpringJUnit4ClassRunner.class)  @b@@ContextConfiguration(locations = { "classpath*:config/spring/spring-database.xml", "classpath*:config/spring/spring-sharding.xml" })  @b@public class ShardingJdbcMybatisTest  {  @b@	@b@	@Resource@b@    public   UserService userService;  @b@      @b@	@Resource@b@    public   StudentService studentService;  @b@@b@    @b@    @Test  @b@    public void testUserInsert() {  @b@    	System.out.println("++++++++++++++++++++++++++++====================================================================");@b@        User u = new User();  @b@        u.setUserId(1114);  @b@        u.setAge(27);  @b@        u.setName("张三4");  @b@        userService.insert(u);@b@    }  @b@      @b@//    @Test  @b@    public void testStudentInsert() {  @b@        Student student = new Student();  @b@        student.setStudentId(211);  @b@        student.setAge(21);  @b@        student.setName("李四");  @b@        Assert.assertEquals(studentService.insert(student), true);  @b@    }  @b@@b@//    @Test  @b@    public void testFindAll(){  @b@        List<User> users = userService.findAll();  @b@        if(null != users && !users.isEmpty()){  @b@            for(User u :users){  @b@                System.out.println(u);  @b@            }  @b@        }  @b@    }  @b@      @b@//    @Test  @b@    public void testSQLIN(){  @b@        List<User> users = userService.findByUserIds(Arrays.asList(1));  @b@        if(null != users && !users.isEmpty()){  @b@            for(User u :users){  @b@                System.out.println(u);  @b@            }  @b@        }  @b@    }  @b@      @b@//    @Test  @b@    public void testTransactionTestSucess(){  @b@        userService.transactionTestSucess();  @b@    }  @b@      @b@//    @Test(expected = IllegalAccessException.class)  @b@    public void testTransactionTestFailure() throws IllegalAccessException{  @b@        userService.transactionTestFailure();  @b@    }  @b@    @b@    @BeforeClass@b@    public static void setUpBeforeClass() throws Exception {@b@        System.out.println("==============单元测试开始=============");@b@    }@b@@b@    @AfterClass@b@    public static void tearDownAfterClass() throws Exception {@b@        System.out.println("==============单元测试结束=============");@b@    }@b@   @b@@b@}

sharding-jdbc分库分表完整(含依赖包&数据脚本)项目示例下载

log4j:WARN Continuable parsing error 55 and column 10@b@log4j:WARN Attribute "value" is required and must be specified for element type "level".@b@log4j:WARN Continuable parsing error 55 and column 22@b@log4j:WARN The content of element type "level" must match "(param)*".@b@DEBUG junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class com.lyz.sharding.test.ShardingJdbcMybatisTest].@b@DEBUG context.BootstrapUtils - Instantiating TestContextBootstrapper from class [org.springframework.test.context.support.DefaultTestContextBootstrapper]@b@DEBUG support.AbstractDelegatingSmartContextLoader - Delegating to GenericXmlContextLoader to process context configuration [ContextConfigurationAttributes@145ee7f declaringClass = 'com.lyz.sharding.test.ShardingJdbcMybatisTest', classes = '{}', locations = '{classpath*:config/spring/spring-database.xml, classpath*:config/spring/spring-sharding.xml}', inheritLocations = true, initializers = '{}', inheritInitializers = true, name = [null], contextLoaderClass = 'org.springframework.test.context.ContextLoader'].@b@DEBUG support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.lyz.sharding.test.ShardingJdbcMybatisTest]@b@DEBUG support.DefaultTestContextBootstrapper - @TestExecutionListeners is not present for class [com.lyz.sharding.test.ShardingJdbcMybatisTest]: using defaults.@b@INFO  support.DefaultTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]@b@INFO  support.DefaultTestContextBootstrapper - Could not instantiate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [org/springframework/web/context/request/RequestAttributes]@b@INFO  support.DefaultTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@13849df, org.springframework.test.context.support.DirtiesContextTestExecutionListener@79f0ec, org.springframework.test.context.transaction.TransactionalTestExecutionListener@1b8424e, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@93ffa]@b@DEBUG annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.lyz.sharding.test.ShardingJdbcMybatisTest]@b@DEBUG annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.lyz.sharding.test.ShardingJdbcMybatisTest]@b@DEBUG annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.lyz.sharding.test.ShardingJdbcMybatisTest]@b@DEBUG annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.lyz.sharding.test.ShardingJdbcMybatisTest]@b@DEBUG annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.lyz.sharding.test.ShardingJdbcMybatisTest]@b@DEBUG annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.lyz.sharding.test.ShardingJdbcMybatisTest]@b@==============单元测试开始=============@b@DEBUG annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.lyz.sharding.test.ShardingJdbcMybatisTest]@b@DEBUG annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.lyz.sharding.test.ShardingJdbcMybatisTest]@b@DEBUG support.DependencyInjectionTestExecutionListener - Performing dependency injection for test context [[DefaultTestContext@e26ffd testClass = ShardingJdbcMybatisTest, testInstance = com.lyz.sharding.test.ShardingJdbcMybatisTest@267cbc, testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@c7345c testClass = ShardingJdbcMybatisTest, locations = '{classpath*:config/spring/spring-database.xml, classpath*:config/spring/spring-sharding.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]].@b@DEBUG support.AbstractDelegatingSmartContextLoader - Delegating to GenericXmlContextLoader to load context from [MergedContextConfiguration@c7345c testClass = ShardingJdbcMybatisTest, locations = '{classpath*:config/spring/spring-database.xml, classpath*:config/spring/spring-sharding.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]].@b@DEBUG support.AbstractGenericContextLoader - Loading ApplicationContext for merged context configuration [[MergedContextConfiguration@c7345c testClass = ShardingJdbcMybatisTest, locations = '{classpath*:config/spring/spring-database.xml, classpath*:config/spring/spring-sharding.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]].@b@DEBUG env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence@b@DEBUG env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence@b@DEBUG env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]@b@INFO  xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/C:/xwood_net/project/xwood-project/sharding-jdbc-mybatis/target/classes/config/spring/spring-database.xml]@b@DEBUG xml.DefaultDocumentLoader - Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl]@b@DEBUG xml.PluggableSchemaResolver - Loading schema mappings from [META-INF/spring.schemas]@b@DEBUG xml.PluggableSchemaResolver - Loaded schema mappings: {http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema/aop/spring-aop-4.1.xsd=org/springframework/aop/config/spring-aop-4.1.xsd, http://www.springframework.org/schema/context/spring-context-3.1.xsd=org/springframework/context/config/spring-context-3.1.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd=org/springframework/jdbc/config/spring-jdbc-4.1.xsd, http://www.springframework.org/schema/util/spring-util-3.0.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-4.1.xsd, http://www.springframework.org/schema/aop/spring-aop-3.2.xsd=org/springframework/aop/config/spring-aop-3.2.xsd, http://mybatis.org/schema/mybatis-spring-1.2.xsd=org/mybatis/spring/config/mybatis-spring-1.2.xsd, http://www.springframework.org/schema/lang/spring-lang-4.1.xsd=org/springframework/scripting/config/spring-lang-4.1.xsd, http://www.springframework.org/schema/context/spring-context-4.0.xsd=org/springframework/context/config/spring-context-4.0.xsd, http://www.springframework.org/schema/tool/spring-tool-4.1.xsd=org/springframework/beans/factory/xml/spring-tool-4.1.xsd, http://www.springframework.org/schema/lang/spring-lang-3.2.xsd=org/springframework/scripting/config/spring-lang-3.2.xsd, http://www.springframework.org/schema/cache/spring-cache-3.2.xsd=org/springframework/cache/config/spring-cache-3.2.xsd, http://www.springframework.org/schema/jee/spring-jee-4.1.xsd=org/springframework/ejb/config/spring-jee-4.1.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd=org/springframework/jdbc/config/spring-jdbc-3.1.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool-3.2.xsd=org/springframework/beans/factory/xml/spring-tool-3.2.xsd, http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-4.1.xsd, http://www.springframework.org/schema/cache/spring-cache-4.1.xsd=org/springframework/cache/config/spring-cache-4.1.xsd, http://www.springframework.org/schema/aop/spring-aop-4.0.xsd=org/springframework/aop/config/spring-aop-4.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.2.xsd=org/springframework/ejb/config/spring-jee-3.2.xsd, http://www.springframework.org/schema/context/spring-context-3.0.xsd=org/springframework/context/config/spring-context-3.0.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-4.0.xsd=org/springframework/jdbc/config/spring-jdbc-4.0.xsd, http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans-3.2.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd, http://www.springframework.org/schema/aop/spring-aop-3.1.xsd=org/springframework/aop/config/spring-aop-3.1.xsd, http://www.springframework.org/schema/lang/spring-lang-4.0.xsd=org/springframework/scripting/config/spring-lang-4.0.xsd, http://www.springframework.org/schema/beans/spring-beans-4.1.xsd=org/springframework/beans/factory/xml/spring-beans-4.1.xsd, http://www.springframework.org/schema/tool/spring-tool-4.0.xsd=org/springframework/beans/factory/xml/spring-tool-4.0.xsd, http://www.springframework.org/schema/lang/spring-lang-3.1.xsd=org/springframework/scripting/config/spring-lang-3.1.xsd, http://www.springframework.org/schema/tx/spring-tx-3.2.xsd=org/springframework/transaction/config/spring-tx-3.2.xsd, http://www.springframework.org/schema/cache/spring-cache-3.1.xsd=org/springframework/cache/config/spring-cache-3.1.xsd, http://www.springframework.org/schema/jee/spring-jee-4.0.xsd=org/springframework/ejb/config/spring-jee-4.0.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd=org/springframework/jdbc/config/spring-jdbc-3.0.xsd, http://www.springframework.org/schema/task/spring-task-4.1.xsd=org/springframework/scheduling/config/spring-task-4.1.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc.xsd=org/springframework/jdbc/config/spring-jdbc-4.1.xsd, http://www.springframework.org/schema/tool/spring-tool-3.1.xsd=org/springframework/beans/factory/xml/spring-tool-3.1.xsd, http://www.springframework.org/schema/tx/spring-tx-4.1.xsd=org/springframework/transaction/config/spring-tx-4.1.xsd, http://www.springframework.org/schema/cache/spring-cache-4.0.xsd=org/springframework/cache/config/spring-cache-4.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.1.xsd=org/springframework/ejb/config/spring-jee-3.1.xsd, http://www.springframework.org/schema/task/spring-task-3.2.xsd=org/springframework/scheduling/config/spring-task-3.2.xsd, http://www.springframework.org/schema/beans/spring-beans-3.1.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-4.1.xsd, http://www.springframework.org/schema/aop/spring-aop-3.0.xsd=org/springframework/aop/config/spring-aop-3.0.xsd, http://www.springframework.org/schema/beans/spring-beans-4.0.xsd=org/springframework/beans/factory/xml/spring-beans-4.0.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-4.1.xsd, http://www.springframework.org/schema/lang/spring-lang-3.0.xsd=org/springframework/scripting/config/spring-lang-3.0.xsd, http://www.springframework.org/schema/tx/spring-tx-3.1.xsd=org/springframework/transaction/config/spring-tx-3.1.xsd, http://mybatis.org/schema/mybatis-spring.xsd=org/mybatis/spring/config/mybatis-spring-1.2.xsd, http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd, http://www.springframework.org/schema/task/spring-task-4.0.xsd=org/springframework/scheduling/config/spring-task-4.0.xsd, http://www.springframework.org/schema/tool/spring-tool-3.0.xsd=org/springframework/beans/factory/xml/spring-tool-3.0.xsd, http://www.springframework.org/schema/tx/spring-tx-4.0.xsd=org/springframework/transaction/config/spring-tx-4.0.xsd, http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.0.xsd=org/springframework/ejb/config/spring-jee-3.0.xsd, http://www.springframework.org/schema/task/spring-task-3.1.xsd=org/springframework/scheduling/config/spring-task-3.1.xsd, http://www.springframework.org/schema/util/spring-util-4.1.xsd=org/springframework/beans/factory/xml/spring-util-4.1.xsd, http://www.springframework.org/schema/beans/spring-beans-3.0.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd, http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-4.1.xsd, http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd, http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/util/spring-util-3.2.xsd=org/springframework/beans/factory/xml/spring-util-3.2.xsd, http://www.springframework.org/schema/task/spring-task.xsd=org/springframework/scheduling/config/spring-task-4.1.xsd, http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/tx/spring-tx-3.0.xsd=org/springframework/transaction/config/spring-tx-3.0.xsd, http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd, http://www.springframework.org/schema/task/spring-task-3.0.xsd=org/springframework/scheduling/config/spring-task-3.0.xsd, http://www.springframework.org/schema/util/spring-util-4.0.xsd=org/springframework/beans/factory/xml/spring-util-4.0.xsd, http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-4.1.xsd, http://www.springframework.org/schema/context/spring-context-3.2.xsd=org/springframework/context/config/spring-context-3.2.xsd, http://www.springframework.org/schema/util/spring-util-3.1.xsd=org/springframework/beans/factory/xml/spring-util-3.1.xsd, http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://www.springframework.org/schema/cache/spring-cache.xsd=org/springframework/cache/config/spring-cache-4.1.xsd, http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-4.1.xsd, http://www.springframework.org/schema/context/spring-context-4.1.xsd=org/springframework/context/config/spring-context-4.1.xsd, http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd, http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://www.alibaba.com/schema/stat.xsd=META-INF/stat.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd=org/springframework/jdbc/config/spring-jdbc-3.2.xsd, http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-4.1.xsd}@b@DEBUG xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/beans/spring-beans-4.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-4.0.xsd@b@DEBUG xml.DefaultBeanDefinitionDocumentReader - Loading bean definitions@b@DEBUG xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0]@b@DEBUG xml.XmlBeanDefinitionReader - Loaded 3 bean definitions from location pattern [classpath*:config/spring/spring-database.xml]@b@INFO  xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/C:/xwood_net/project/xwood-project/sharding-jdbc-mybatis/target/classes/config/spring/spring-sharding.xml]@b@DEBUG xml.DefaultDocumentLoader - Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl]@b@DEBUG xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/beans/spring-beans-4.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-4.0.xsd@b@DEBUG xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/context/spring-context-4.0.xsd] in classpath: org/springframework/context/config/spring-context-4.0.xsd@b@DEBUG xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/tool/spring-tool-4.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-tool-4.0.xsd@b@DEBUG xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/tx/spring-tx-4.0.xsd] in classpath: org/springframework/transaction/config/spring-tx-4.0.xsd@b@DEBUG xml.DefaultBeanDefinitionDocumentReader - Loading bean definitions@b@DEBUG xml.DefaultNamespaceHandlerResolver - Loaded NamespaceHandler mappings: {http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler, http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler, http://www.alibaba.com/schema/stat=com.alibaba.druid.support.spring.stat.config.DruidStatNamespaceHandler, http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler, http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler, http://www.springframework.org/schema/jdbc=org.springframework.jdbc.config.JdbcNamespaceHandler, http://www.springframework.org/schema/cache=org.springframework.cache.config.CacheNamespaceHandler, http://mybatis.org/schema/mybatis-spring=org.mybatis.spring.config.NamespaceHandler, http://www.springframework.org/schema/c=org.springframework.beans.factory.xml.SimpleConstructorNamespaceHandler, http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler, http://www.springframework.org/schema/task=org.springframework.scheduling.config.TaskNamespaceHandler, http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler, http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler}@b@DEBUG annotation.ClassPathBeanDefinitionScanner - JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning@b@DEBUG support.PathMatchingResourcePatternResolver - Looking for matching resources in directory tree [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\test-classes\com\lyz\sharding]@b@DEBUG support.PathMatchingResourcePatternResolver - Searching directory [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\test-classes\com\lyz\sharding] for files matching pattern [C:/xwood_net/project/xwood-project/sharding-jdbc-mybatis/target/test-classes/com/lyz/sharding/**/*.class]@b@DEBUG support.PathMatchingResourcePatternResolver - Searching directory [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\test-classes\com\lyz\sharding\test] for files matching pattern [C:/xwood_net/project/xwood-project/sharding-jdbc-mybatis/target/test-classes/com/lyz/sharding/**/*.class]@b@DEBUG support.PathMatchingResourcePatternResolver - Looking for matching resources in directory tree [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding]@b@DEBUG support.PathMatchingResourcePatternResolver - Searching directory [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding] for files matching pattern [C:/xwood_net/project/xwood-project/sharding-jdbc-mybatis/target/classes/com/lyz/sharding/**/*.class]@b@DEBUG support.PathMatchingResourcePatternResolver - Searching directory [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\algorithm] for files matching pattern [C:/xwood_net/project/xwood-project/sharding-jdbc-mybatis/target/classes/com/lyz/sharding/**/*.class]@b@DEBUG support.PathMatchingResourcePatternResolver - Searching directory [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\entity] for files matching pattern [C:/xwood_net/project/xwood-project/sharding-jdbc-mybatis/target/classes/com/lyz/sharding/**/*.class]@b@DEBUG support.PathMatchingResourcePatternResolver - Searching directory [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\mapper] for files matching pattern [C:/xwood_net/project/xwood-project/sharding-jdbc-mybatis/target/classes/com/lyz/sharding/**/*.class]@b@DEBUG support.PathMatchingResourcePatternResolver - Searching directory [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\service] for files matching pattern [C:/xwood_net/project/xwood-project/sharding-jdbc-mybatis/target/classes/com/lyz/sharding/**/*.class]@b@DEBUG support.PathMatchingResourcePatternResolver - Searching directory [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\service\impl] for files matching pattern [C:/xwood_net/project/xwood-project/sharding-jdbc-mybatis/target/classes/com/lyz/sharding/**/*.class]@b@DEBUG support.PathMatchingResourcePatternResolver - Resolved location pattern [classpath*:com/lyz/sharding/**/*.class] to resources [file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\test-classes\com\lyz\sharding\test\BaseJunitTest.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\test-classes\com\lyz\sharding\test\ShardingJdbcMybatisTest.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\algorithm\StudentSingleKeyDatabaseShardingAlgorithm.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\algorithm\StudentSingleKeyTableShardingAlgorithm.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\algorithm\UserSingleKeyDatabaseShardingAlgorithm.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\algorithm\UserSingleKeyTableShardingAlgorithm.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\entity\Student.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\entity\User.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\mapper\StudentMapper.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\mapper\UserMapper.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\service\impl\StudentServiceImpl.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\service\impl\UserServiceImpl.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\service\StudentService.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\service\UserService.class]]@b@DEBUG annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\service\impl\StudentServiceImpl.class]@b@DEBUG annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\service\impl\UserServiceImpl.class]@b@DEBUG xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [org.mybatis.spring.mapper.MapperScannerConfigurer#0]@b@DEBUG xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.lyz.sharding.algorithm.UserSingleKeyDatabaseShardingAlgorithm#1c863cf]@b@DEBUG xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.lyz.sharding.algorithm.UserSingleKeyTableShardingAlgorithm#110bc5c]@b@DEBUG xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.lyz.sharding.algorithm.StudentSingleKeyDatabaseShardingAlgorithm#1be72ee]@b@DEBUG xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.lyz.sharding.algorithm.StudentSingleKeyTableShardingAlgorithm#6b736f]@b@DEBUG xml.XmlBeanDefinitionReader - Loaded 22 bean definitions from location pattern [classpath*:config/spring/spring-sharding.xml]@b@INFO  support.GenericApplicationContext - Refreshing org.springframework.context.support.GenericApplicationContext@1ada1e0: startup date [Wed May 29 00:27:19 CST 2019]; root of context hierarchy@b@DEBUG support.GenericApplicationContext - Bean factory for org.springframework.context.support.GenericApplicationContext@1ada1e0: org.springframework.beans.factory.support.DefaultListableBeanFactory@158cfda: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,sharding_0,sharding_1,studentServiceImpl,userServiceImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.mybatis.spring.mapper.MapperScannerConfigurer#0,sqlSessionFactory,dataSourceRule,userTableRule,userDatabaseShardingStrategy,userTableShardingStrategy,studentTableRule,studentDatabaseShardingStrategy,studentTableShardingStrategy,shardingRule,shardingDataSource,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor]; root of factory hierarchy@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'@b@DEBUG env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence@b@DEBUG env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence@b@DEBUG env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]@b@DEBUG support.PathMatchingResourcePatternResolver - Looking for matching resources in directory tree [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\mapper]@b@DEBUG support.PathMatchingResourcePatternResolver - Searching directory [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\mapper] for files matching pattern [C:/xwood_net/project/xwood-project/sharding-jdbc-mybatis/target/classes/com/lyz/sharding/mapper/**/*.class]@b@DEBUG support.PathMatchingResourcePatternResolver - Resolved location pattern [classpath*:com/lyz/sharding/mapper/**/*.class] to resources [file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\mapper\StudentMapper.class], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\mapper\UserMapper.class]]@b@DEBUG mapper.ClassPathMapperScanner - Identified candidate component class: file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\mapper\StudentMapper.class]@b@DEBUG mapper.ClassPathMapperScanner - Identified candidate component class: file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\com\lyz\sharding\mapper\UserMapper.class]@b@DEBUG mapper.ClassPathMapperScanner - Creating MapperFactoryBean with name 'studentMapper' and 'com.lyz.sharding.mapper.StudentMapper' mapperInterface@b@DEBUG mapper.ClassPathMapperScanner - Creating MapperFactoryBean with name 'userMapper' and 'com.lyz.sharding.mapper.UserMapper' mapperInterface@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0'@b@INFO  config.PropertyPlaceholderConfigurer - Loading properties file from class path resource [config/resource/jdbc_dev.properties]@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.aop.config.internalAutoProxyCreator'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.aop.config.internalAutoProxyCreator'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.aop.config.internalAutoProxyCreator' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.aop.config.internalAutoProxyCreator'@b@DEBUG support.GenericApplicationContext - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@b8ee33]@b@DEBUG support.GenericApplicationContext - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@4bffe5]@b@DEBUG support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@158cfda: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,sharding_0,sharding_1,studentServiceImpl,userServiceImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.mybatis.spring.mapper.MapperScannerConfigurer#0,sqlSessionFactory,dataSourceRule,userTableRule,userDatabaseShardingStrategy,userTableShardingStrategy,studentTableRule,studentDatabaseShardingStrategy,studentTableShardingStrategy,shardingRule,shardingDataSource,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor,studentMapper,userMapper]; root of factory hierarchy@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'sharding_0'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'sharding_0'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'sharding_0' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Invoking init method  'init' on bean with name 'sharding_0'@b@INFO  pool.DruidDataSource - {dataSource-1} inited@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.transaction.config.internalTransactionAdvisor' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0' to allow for resolving potential circular references@b@DEBUG autoproxy.BeanFactoryAdvisorRetrievalHelper - Skipping currently created advisor 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'sharding_0'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'sharding_1'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'sharding_1'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'sharding_1' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Invoking init method  'init' on bean with name 'sharding_1'@b@INFO  pool.DruidDataSource - {dataSource-2} inited@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'sharding_1'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'studentServiceImpl'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'studentServiceImpl'@b@DEBUG annotation.InjectionMetadata - Registered injected element on class [com.lyz.sharding.service.impl.StudentServiceImpl]: ResourceElement for public com.lyz.sharding.mapper.StudentMapper com.lyz.sharding.service.impl.StudentServiceImpl.studentMapper@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'studentServiceImpl' to allow for resolving potential circular references@b@DEBUG annotation.InjectionMetadata - Processing injected element of bean 'studentServiceImpl': ResourceElement for public com.lyz.sharding.mapper.StudentMapper com.lyz.sharding.service.impl.StudentServiceImpl.studentMapper@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'studentMapper'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'studentMapper'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'studentMapper' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'sqlSessionFactory'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'sqlSessionFactory'@b@DEBUG logging.LogFactory - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'sqlSessionFactory' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'shardingDataSource'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'shardingDataSource'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'shardingRule'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'shardingRule'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'dataSourceRule'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'dataSourceRule'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sharding_0'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sharding_1'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'dataSourceRule' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'dataSourceRule'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'userTableRule'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'userTableRule'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'dataSourceRule'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'userDatabaseShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'userDatabaseShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'com.lyz.sharding.algorithm.UserSingleKeyDatabaseShardingAlgorithm#1c863cf'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'com.lyz.sharding.algorithm.UserSingleKeyDatabaseShardingAlgorithm#1c863cf'@b@DEBUG beans.BeanUtils - No property editor [com.dangdang.ddframe.rdb.sharding.api.strategy.database.MultipleKeysDatabaseShardingAlgorithmEditor] found for type com.dangdang.ddframe.rdb.sharding.api.strategy.database.MultipleKeysDatabaseShardingAlgorithm according to 'Editor' suffix convention@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'userDatabaseShardingStrategy' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'userDatabaseShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'userTableShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'userTableShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'com.lyz.sharding.algorithm.UserSingleKeyTableShardingAlgorithm#110bc5c'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'com.lyz.sharding.algorithm.UserSingleKeyTableShardingAlgorithm#110bc5c'@b@DEBUG beans.BeanUtils - No property editor [com.dangdang.ddframe.rdb.sharding.api.strategy.table.MultipleKeysTableShardingAlgorithmEditor] found for type com.dangdang.ddframe.rdb.sharding.api.strategy.table.MultipleKeysTableShardingAlgorithm according to 'Editor' suffix convention@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'userTableShardingStrategy' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'userTableShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'userTableRule' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'userTableRule'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'studentTableRule'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'studentTableRule'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'dataSourceRule'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'studentDatabaseShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'studentDatabaseShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'com.lyz.sharding.algorithm.StudentSingleKeyDatabaseShardingAlgorithm#1be72ee'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'com.lyz.sharding.algorithm.StudentSingleKeyDatabaseShardingAlgorithm#1be72ee'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'studentDatabaseShardingStrategy' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'studentDatabaseShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'studentTableShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'studentTableShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'com.lyz.sharding.algorithm.StudentSingleKeyTableShardingAlgorithm#6b736f'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'com.lyz.sharding.algorithm.StudentSingleKeyTableShardingAlgorithm#6b736f'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'studentTableShardingStrategy' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'studentTableShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'studentTableRule' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'studentTableRule'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'shardingRule' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'shardingRule'@b@Wed May 29 00:27:21 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.@b@Wed May 29 00:27:22 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'shardingDataSource' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'shardingDataSource'@b@DEBUG support.PathMatchingResourcePatternResolver - Looking for matching resources in directory tree [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\config\mapper]@b@DEBUG support.PathMatchingResourcePatternResolver - Searching directory [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\config\mapper] for files matching pattern [C:/xwood_net/project/xwood-project/sharding-jdbc-mybatis/target/classes/config/mapper/*Mapper.xml]@b@DEBUG support.PathMatchingResourcePatternResolver - Resolved location pattern [classpath*:config/mapper/*Mapper.xml] to resources [file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\config\mapper\StudentMapper.xml], file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\config\mapper\UserMapper.xml]]@b@DEBUG support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'sqlSessionFactory'@b@DEBUG spring.SqlSessionFactoryBean - Property 'configLocation' not specified, using default MyBatis Configuration@b@DEBUG spring.SqlSessionFactoryBean - Parsed mapper file: 'file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\config\mapper\StudentMapper.xml]'@b@DEBUG spring.SqlSessionFactoryBean - Parsed mapper file: 'file [C:\xwood_net\project\xwood-project\sharding-jdbc-mybatis\target\classes\config\mapper\UserMapper.xml]'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'sqlSessionFactory'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'studentMapper'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'studentMapper'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'studentServiceImpl'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'userServiceImpl'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'userServiceImpl'@b@DEBUG annotation.InjectionMetadata - Registered injected element on class [com.lyz.sharding.service.impl.UserServiceImpl]: ResourceElement for public com.lyz.sharding.mapper.UserMapper com.lyz.sharding.service.impl.UserServiceImpl.userMapper@b@DEBUG annotation.InjectionMetadata - Registered injected element on class [com.lyz.sharding.service.impl.UserServiceImpl]: ResourceElement for public com.lyz.sharding.mapper.StudentMapper com.lyz.sharding.service.impl.UserServiceImpl.studentMapper@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'userServiceImpl' to allow for resolving potential circular references@b@DEBUG annotation.InjectionMetadata - Processing injected element of bean 'userServiceImpl': ResourceElement for public com.lyz.sharding.mapper.UserMapper com.lyz.sharding.service.impl.UserServiceImpl.userMapper@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'userMapper'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'userMapper'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'userMapper' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sqlSessionFactory'@b@DEBUG support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'userMapper'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'userMapper'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG annotation.InjectionMetadata - Processing injected element of bean 'userServiceImpl': ResourceElement for public com.lyz.sharding.mapper.StudentMapper com.lyz.sharding.service.impl.UserServiceImpl.studentMapper@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'studentMapper'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG annotation.AnnotationTransactionAttributeSource - Adding transactional method 'UserServiceImpl.transactionTestFailure' with attribute: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ''@b@DEBUG autoproxy.InfrastructureAdvisorAutoProxyCreator - Creating implicit proxy for bean 'userServiceImpl' with 0 common interceptors and 1 specific interceptors@b@DEBUG framework.JdkDynamicAopProxy - Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [com.lyz.sharding.service.impl.UserServiceImpl@8e86bd]@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'userServiceImpl'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sqlSessionFactory'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'dataSourceRule'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'userTableRule'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'userDatabaseShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'userTableShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'studentTableRule'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'studentDatabaseShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'studentTableShardingStrategy'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'shardingRule'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'shardingDataSource'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'transactionManager'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'transactionManager'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'transactionManager' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'shardingDataSource'@b@DEBUG support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'transactionManager'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'transactionManager'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.aop.config.internalAutoProxyCreator'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0'@b@DEBUG support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.transaction.interceptor.TransactionInterceptor#0'@b@DEBUG support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.transaction.interceptor.TransactionInterceptor#0'@b@DEBUG support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.transaction.interceptor.TransactionInterceptor#0' to allow for resolving potential circular references@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0'@b@DEBUG support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'org.springframework.transaction.interceptor.TransactionInterceptor#0'@b@DEBUG support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.transaction.interceptor.TransactionInterceptor#0'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'studentMapper'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'userMapper'@b@DEBUG support.GenericApplicationContext - Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor@1d6ed05]@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'lifecycleProcessor'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sqlSessionFactory'@b@DEBUG env.PropertySourcesPropertyResolver - Searching for key 'spring.liveBeansView.mbeanDomain' in [systemProperties]@b@DEBUG env.PropertySourcesPropertyResolver - Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment]@b@DEBUG env.PropertySourcesPropertyResolver - Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null]@b@DEBUG context.DefaultCacheAwareContextLoaderDelegate - Storing ApplicationContext in cache under key [[MergedContextConfiguration@c7345c testClass = ShardingJdbcMybatisTest, locations = '{classpath*:config/spring/spring-database.xml, classpath*:config/spring/spring-sharding.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]@b@DEBUG context.cache - Spring test ApplicationContext cache statistics: [ContextCache@1883a4c size = 1, hitCount = 0, missCount = 1, parentContextCount = 0]@b@DEBUG annotation.InjectionMetadata - Processing injected element of bean 'com.lyz.sharding.test.ShardingJdbcMybatisTest': ResourceElement for public com.lyz.sharding.service.UserService com.lyz.sharding.test.ShardingJdbcMybatisTest.userService@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'userServiceImpl'@b@DEBUG annotation.InjectionMetadata - Processing injected element of bean 'com.lyz.sharding.test.ShardingJdbcMybatisTest': ResourceElement for public com.lyz.sharding.service.StudentService com.lyz.sharding.test.ShardingJdbcMybatisTest.studentService@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'studentServiceImpl'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'@b@++++++++++++++++++++++++++++====================================================================@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.transaction.interceptor.TransactionInterceptor#0'@b@DEBUG annotation.AnnotationTransactionAttributeSource - Adding transactional method 'UserServiceImpl.insert' with attribute: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ''@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'transactionManager'@b@DEBUG datasource.DataSourceTransactionManager - Creating new transaction with name [com.lyz.sharding.service.impl.UserServiceImpl.insert]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ''@b@DEBUG datasource.DataSourceTransactionManager - Acquired Connection [com.dangdang.ddframe.rdb.sharding.jdbc.ShardingConnection@a100c9] for JDBC transaction@b@DEBUG datasource.DataSourceTransactionManager - Switching JDBC Connection [com.dangdang.ddframe.rdb.sharding.jdbc.ShardingConnection@a100c9] to manual commit@b@DEBUG spring.SqlSessionUtils - Creating a new SqlSession@b@DEBUG spring.SqlSessionUtils - Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@103ac05]@b@DEBUG transaction.SpringManagedTransaction - JDBC Connection [com.dangdang.ddframe.rdb.sharding.jdbc.ShardingConnection@a100c9] will be managed by Spring@b@DEBUG UserMapper.insert - ooo Using Connection [com.dangdang.ddframe.rdb.sharding.jdbc.ShardingConnection@a100c9]@b@DEBUG UserMapper.insert - ==>  Preparing: insert into t_user (user_id,name,age) values (?,?,?) @b@DEBUG UserMapper.insert - ==> Parameters: 1114(Integer), ����4(String), 27(Integer)@b@DEBUG parser.SQLParserFactory - Logic SQL:   @b@    insert into t_user (user_id,name,age) values (?,?,?)  @b@  @b@DEBUG parser.SQLParseEngine - Parsed SQL result: SQLParsedResult(routeContext=RouteContext(tables=[Table(name=t_user, alias=Optional.absent())], sqlBuilder=null), conditionContexts=[ConditionContext(conditions={Condition.Column(columnName=user_id, tableName=t_user)=Condition(column=Condition.Column(columnName=user_id, tableName=t_user), operator==, values=[1114])})], mergeContext=MergeContext(orderByColumns=[], groupByColumns=[], aggregationColumns=[], limit=null))@b@DEBUG parser.SQLParseEngine - Parsed SQL: INSERT INTO [Token(t_user)] (user_id, name, age) VALUES (?, ?, ?)@b@DEBUG router.SQLExecutionUnit - route sql to db: [sharding_0] sql: [INSERT INTO t_user_01 (user_id, name, age) VALUES (?, ?, ?)]@b@Wed May 29 00:27:24 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.@b@DEBUG UserMapper.insert - <==    Updates: 1@b@DEBUG spring.SqlSessionUtils - Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@103ac05]@b@DEBUG spring.SqlSessionUtils - Transaction synchronization committing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@103ac05]@b@DEBUG spring.SqlSessionUtils - Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@103ac05]@b@DEBUG spring.SqlSessionUtils - Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@103ac05]@b@DEBUG datasource.DataSourceTransactionManager - Initiating transaction commit@b@DEBUG datasource.DataSourceTransactionManager - Committing JDBC transaction on Connection [com.dangdang.ddframe.rdb.sharding.jdbc.ShardingConnection@a100c9]@b@DEBUG datasource.DataSourceUtils - Resetting read-only flag of JDBC Connection [com.dangdang.ddframe.rdb.sharding.jdbc.ShardingConnection@a100c9]@b@DEBUG datasource.DataSourceTransactionManager - Releasing JDBC Connection [com.dangdang.ddframe.rdb.sharding.jdbc.ShardingConnection@a100c9] after transaction@b@DEBUG datasource.DataSourceUtils - Returning JDBC Connection to DataSource@b@DEBUG support.DirtiesContextTestExecutionListener - After test method: context [DefaultTestContext@e26ffd testClass = ShardingJdbcMybatisTest, testInstance = com.lyz.sharding.test.ShardingJdbcMybatisTest@267cbc, testMethod = testUserInsert@ShardingJdbcMybatisTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@c7345c testClass = ShardingJdbcMybatisTest, locations = '{classpath*:config/spring/spring-database.xml, classpath*:config/spring/spring-sharding.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]], class dirties context [false], class mode [null], method dirties context [false].@b@==============单元测试结束=============@b@DEBUG support.DirtiesContextTestExecutionListener - After test class: context [DefaultTestContext@e26ffd testClass = ShardingJdbcMybatisTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@c7345c testClass = ShardingJdbcMybatisTest, locations = '{classpath*:config/spring/spring-database.xml, classpath*:config/spring/spring-sharding.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]], dirtiesContext [false].@b@INFO  support.GenericApplicationContext - Closing org.springframework.context.support.GenericApplicationContext@1ada1e0: startup date [Wed May 29 00:27:19 CST 2019]; root of context hierarchy@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sqlSessionFactory'@b@DEBUG support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'lifecycleProcessor'@b@DEBUG support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@158cfda: defining beans [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,sharding_0,sharding_1,studentServiceImpl,userServiceImpl,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.mybatis.spring.mapper.MapperScannerConfigurer#0,sqlSessionFactory,dataSourceRule,userTableRule,userDatabaseShardingStrategy,userTableShardingStrategy,studentTableRule,studentDatabaseShardingStrategy,studentTableShardingStrategy,shardingRule,shardingDataSource,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor,studentMapper,userMapper]; root of factory hierarchy@b@DEBUG support.DefaultListableBeanFactory - Retrieved dependent beans for bean 'userServiceImpl': [com.lyz.sharding.test.ShardingJdbcMybatisTest]@b@DEBUG support.DefaultListableBeanFactory - Retrieved dependent beans for bean 'com.lyz.sharding.algorithm.StudentSingleKeyTableShardingAlgorithm#6b736f': [studentTableShardingStrategy]@b@DEBUG support.DefaultListableBeanFactory - Retrieved dependent beans for bean 'com.lyz.sharding.algorithm.StudentSingleKeyDatabaseShardingAlgorithm#1be72ee': [studentDatabaseShardingStrategy]@b@DEBUG support.DefaultListableBeanFactory - Retrieved dependent beans for bean 'com.lyz.sharding.algorithm.UserSingleKeyTableShardingAlgorithm#110bc5c': [userTableShardingStrategy]@b@DEBUG support.DefaultListableBeanFactory - Retrieved dependent beans for bean 'com.lyz.sharding.algorithm.UserSingleKeyDatabaseShardingAlgorithm#1c863cf': [userDatabaseShardingStrategy]@b@DEBUG support.DisposableBeanAdapter - Invoking destroy method 'close' on bean with name 'sharding_1'@b@INFO  pool.DruidDataSource - {dataSource-2} closed@b@DEBUG support.DisposableBeanAdapter - Invoking destroy method 'close' on bean with name 'sharding_0'@b@INFO  pool.DruidDataSource - {dataSource-1} closed

三、mycat和sharding-jdbc对比

1)mycat是一个中间件的第三方应用,sharding-jdbc是一个jar包@b@2)使用mycat时不需要改代码,而使用sharding-jdbc时需要修改代码

Mycat(proxy中间件层,详细配置测试验证教程参见其他文章):

sharding-jdbc分库分表完整(含依赖包&数据脚本)项目示例下载

Sharding-jdbc(TDDL为代表的应用层):

sharding-jdbc分库分表完整(含依赖包&数据脚本)项目示例下载




<<热门下载>>