java - Comparing 2 tables in different databases and do a delta -


i have standalone java application embedded h2 database(d1) , table t1. have mysql database(d2) table t2 hosted on server. requirement pull full data d2.t2 , push d1.t1 . t1 , t2 both have same table definition. first pull not problem. starting 2nd pull need pull rows got updated in d2.t2 , update in d1.t2 . how can achieved? have find delta last time pulled , update rows.

if structures on both tables same can try following sql statement:

insert your_table      (your_column, ...)  values      (your_value, ...)  on dublicate key update      your_column = your_value, ... 

your have entries source database , execute above statement each 1 on target database.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -