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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/th-dev% 40onlinehome.de

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to