项目实践 现在Java项目使用mybatis多一些,所以我也做了一个springboot+mybatisplus+sharding-jdbc分库分表项目例子分享给大家. 要是用的springboot+jpa可以看这篇文章:https://www.cnblogs.com/owenma/p/11364624.html 其它的框架内容不做赘述,直接上代码. 数据准备 装备两个数据库.并在两个库中建表,建表sql如下: DROP TABLE IF EXISTS `t_user_0`; CREATE TA
1: 在mysql中,手动提交事务的案例:CREATE PROCEDURE tfer_funds (from_account int, to_account int, tfer_amount numeric(10,2)) BEGIN SET autocommit=0; UPDATE account_balance SET balance=balance-tfer_amount WHERE account_id=from_account;