Wiki source code of Database Compatibility and Comparisons-DataMigration
Last modified by Pascal Robert on 2007/09/03 20:57
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
3.1 | 1 | == Project Wonder == |
| |
1.1 | 2 | |
| 3 | ProjectWonder provides a really handy tool for migrating data between two databases: | ||
| 4 | |||
| |
3.1 | 5 | {{code}} |
| |
1.1 | 6 | |
| |
3.1 | 7 | NSMutableDictionary sourceDict = new NSMutableDictionary(); |
| 8 | sourceDict.setObjectForKey("YourPassword", "password"); | ||
| 9 | sourceDict.setObjectForKey("YourUserName", "username"); | ||
| 10 | sourceDict.setObjectForKey("jdbc:FrontBase://127.0.0.1/YourSourceDatabase", "URL"); | ||
| 11 | sourceDict.setObjectForKey("com.frontbase.jdbc.FBJDriver", "driver"); | ||
| 12 | sourceDict.setObjectForKey(Boolean.FALSE.toString(), "autoCommit"); | ||
| 13 | sourceDict.setObjectForKey(Boolean.TRUE.toString(), "readOnly"); | ||
| 14 | sourceDict.setObjectForKey(Boolean.TRUE.toString(), "quote"); | ||
| |
1.1 | 15 | |
| |
3.1 | 16 | NSMutableDictionary destDict = sourceDict.mutableClone(); |
| 17 | destDict.setObjectForKey("jdbc:postgresql://localhost/YourDestinationDatabase", "URL"); | ||
| 18 | destDict.setObjectForKey("YourPassword", "password"); | ||
| 19 | destDict.setObjectForKey("YourUserName", "username"); | ||
| 20 | destDict.setObjectForKey("org.postgresql.Driver", "driver"); | ||
| 21 | destDict.setObjectForKey(Boolean.FALSE.toString(), "autoCommit"); | ||
| 22 | destDict.setObjectForKey(Boolean.FALSE.toString(), "readOnly"); | ||
| 23 | destDict.setObjectForKey(Boolean.FALSE.toString(), "quote"); | ||
| 24 | |||
| 25 | EOModel model = EOModelGroup.defaultGroup().modelNamed("YourModelName"); | ||
| 26 | ERXJDBCUtilities._copyDatabaseDefinedByEOModelAndConnectionDictionaryToDatabaseWithConnectionDictionary(model, sourceDict, destDict); | ||
| 27 | |||
| 28 | {{/code}} |