整體介紹條件:
數據庫爲mysql ORM爲mybatis
mybatis執行順序爲 :
1.獲取DefaultSqlSession
2.生成Executor
3.獲取StatementHandler
4.調用StatementHandler,通過connection獲取Statement
5.根據SQL請求執行Statement相應的方法
6.調用ResultSetHandler進行結果處理
從上面使用配置可以看出shadingjdbc封裝了一些主要對象
1.connection:ShardingConnection
2.dataSource:ShardingDataSource
3.Statement:ShardingPreparedStatement
4.ResultSet:ShardingResultSet
整體方法調用流程圖:
後面的文章會對,解析,路由,重寫,執行,合併進行分佈詳細講解。