Menu

about get other engine

Help
ikezheng
2018-12-19
2018-12-20
  • ikezheng

    ikezheng - 2018-12-19

    Hi,
    I have A database(mysql) and B database(sqlserver)

    On A database(mysql):
    public class MyFilter extends DatabaseWriterFilterAdapter implements ISymmetricEngineAware {
    protected ISymmetricEngine engine;

    @Override
    public void setSymmetricEngine(ISymmetricEngine engine) {
        this.engine = engine;
    }
    @Override
    public void afterWrite(DataContext context, Table table, CsvData data) {
        if (table.getName().equalsIgnoreCase("HR_ATS_Holiday")
                && data.getDataEventType().equals(DataEventType.INSERT)) {
                    ISqlTemplate myengine = engine.getSqlTemplate();
                    //CsvData data and  ISqlTemplate myengine belongs to A database
                    //I want to write A(CsvData data) to B,How can I write code?
    
            }
    

    Thanks for any help,

    Ike

     
  • Mark Michalek

    Mark Michalek - 2018-12-19
     
    • ikezheng

      ikezheng - 2018-12-20

      This is exactly what I need, thank you very much.

       

Log in to post a comment.