/*
package com.tashow.cloud.canal.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

@Service
public class Canaldb {

    @Autowired
    private JdbcTemplate jdbcTemplate;
    @DS("slave")
    public void execute(String sql) {
        try {
            String ds = DynamicDataSourceContextHolder.peek(); // 调试查看当前数据源
            System.out.println("当前数据源：" + ds);
            System.out.println("[execute]----> " + sql);
            jdbcTemplate.execute(sql);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
*/
