Guest User

Untitled

a guest
Jul 16th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. package de.androbit.db.migrator;
  2.  
  3. import java.io.File;
  4. import java.util.ArrayList;
  5. import java.util.List;
  6.  
  7. public class DbMigrationMain {
  8.  
  9. private static final String TEST_XML_FILE = "test.xml";
  10.  
  11. /**
  12. * @param args
  13. */
  14. public static void main(String[] args) {
  15. DbMigrator migrator = new DbMigrator();
  16. migrator.setExportConnection("jdbc:mysql://localhost:3306/database", "user",
  17. "password");
  18. migrator.setImportConnection("jdbc:mysql://localhost:3306/database",
  19. "user", "password");
  20.  
  21. List<String> tableNames = new ArrayList<String>();
  22.  
  23. tableNames.add("tabletoexport");
  24.  
  25. migrator.exportTables(new File(TEST_XML_FILE), tableNames);
  26. // uncomment to import
  27. //migrator.importXmlDataSet(new File(TEST_XML_FILE));
  28. }
  29.  
  30. }
Add Comment
Please, Sign In to add comment