Re: Using Wonder to transfer data from one DB to another
Re: Using Wonder to transfer data from one DB to another
- Subject: Re: Using Wonder to transfer data from one DB to another
- From: Timo Hoepfner <email@hidden>
- Date: Mon, 18 Feb 2008 13:49:57 +0100
ERXJDBCUtilities._copyDatabaseDefinedByEOModelAndConnectionDictionaryToD
atabaseWithConnectionDictionary(...)
Sample usage:
public class MigrationTool {
public static void main(String[] args) {
// 1. Create target database
// 2. Create tables in target database using EntityModeler
// 3. Run this class using ERXMainRunner
// 4. Make target database config active in EntityModeler AND
// 5. Change Properties file to connect to target database
// 6. Done
NSMutableDictionary src = new NSMutableDictionary();
src.setObjectForKey("com.mysql.jdbc.Driver", "driver");
src.setObjectForKey("jdbc:mysql://localhost/some_db", "URL");
src.setObjectForKey("user", "username");
src.setObjectForKey("pass", "password");
src.setObjectForKey(Boolean.FALSE.toString(), "autoCommit");
src.setObjectForKey(Boolean.TRUE.toString(), "readOnly");
src.setObjectForKey(Boolean.FALSE.toString(), "quote");
NSMutableDictionary dest = new NSMutableDictionary();
dest.setObjectForKey("com.frontbase.jdbc.FBJDriver", "driver");
dest.setObjectForKey("FrontbasePlugIn", "plugin"); // not sure if
needed
dest.setObjectForKey("jdbc:frontbase://localhost/some_db", "URL");
dest.setObjectForKey("user", "username");
dest.setObjectForKey("pass", "password");
dest.setObjectForKey(Boolean.FALSE.toString(), "autoCommit");
dest.setObjectForKey(Boolean.FALSE.toString(), "readOnly");
dest.setObjectForKey(Boolean.TRUE.toString(), "quote");
// alternatively use EOModelGroup
EOModel model = ERXModelGroup.defaultGroup().modelNamed("YourModel");
ERXJDBCUtilities._copyDatabaseDefinedByEOModelAndConnectionDictionaryToD
atabaseWithConnectionDictionary(model, src, dest);
}
}
Timo
Am 18.02.2008 um 13:17 schrieb Archibal Singleton:
Hello,
I seem to recall that a few weeks ago (*), Mike posted a small code
snippet showing how to use some Wonder utility methods (ie not
javaeoutil IIRC) to transfer data from one DB to another using 2
different DB connection dictionaries.
I've searched the various WO lists but can't seem to find it. I've
also checked Wonder API docs in ERXEOAccessUtilities but to no avail.
Any help in finding this post would be much appreciated.
TIA
= tmk =
(*) Not sure if Mike's post is a few weeks old but I *read* it a
few weeks ago...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40onlinehome.de
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden