< WebObjects < Database Compatibility and Comparisons
Project Wonder
ProjectWonder provides a really handy tool for migrating data between two databases:
NSMutableDictionary sourceDict = new NSMutableDictionary(); sourceDict.setObjectForKey("YourPassword", "password"); sourceDict.setObjectForKey("YourUserName", "username"); sourceDict.setObjectForKey("jdbc:FrontBase://127.0.0.1/YourSourceDatabase", "URL"); sourceDict.setObjectForKey("com.frontbase.jdbc.FBJDriver", "driver"); sourceDict.setObjectForKey(Boolean.FALSE.toString(), "autoCommit"); sourceDict.setObjectForKey(Boolean.TRUE.toString(), "readOnly"); sourceDict.setObjectForKey(Boolean.TRUE.toString(), "quote"); NSMutableDictionary destDict = sourceDict.mutableClone(); destDict.setObjectForKey("jdbc:postgresql://localhost/YourDestinationDatabase", "URL"); destDict.setObjectForKey("YourPassword", "password"); destDict.setObjectForKey("YourUserName", "username"); destDict.setObjectForKey("org.postgresql.Driver", "driver"); destDict.setObjectForKey(Boolean.FALSE.toString(), "autoCommit"); destDict.setObjectForKey(Boolean.FALSE.toString(), "readOnly"); destDict.setObjectForKey(Boolean.FALSE.toString(), "quote"); EOModel model = EOModelGroup.defaultGroup().modelNamed("YourModelName"); ERXJDBCUtilities._copyDatabaseDefinedByEOModelAndConnectionDictionaryToDatabaseWithConnectionDictionary(model, sourceDict, destDict);
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.