Menu

help,How to get engine?

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

    ikezheng - 2018-12-19

    Hi,
    A database (mysql)
    B database (sqlserver)

    on A(mysql) use

    public class MyFilter extends DatabaseWriterFilterAdapter implements ISymmetricEngineAware{
    @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();

            //now,     CsvData data and     ISqlTemplate myengine is B
    
            //I want to write         B.data         to A
    
       }
    
    }---
    

    Thanks!
    ike

     
  • Mark Michalek

    Mark Michalek - 2018-12-19

    Ike - you could look up en engine like this.

    ISymmetricEngine engine = AbstractSymmetricEngine.findEngineByName(engineName);

     
    • ikezheng

      ikezheng - 2018-12-20

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

       

Log in to post a comment.