Please see with the below steps, if it works for you, I am also modifying the beta2 sample readme to include the same instructions for use with other dbs like MySQL, DB2 etc.
On 9/17/07, Amita Vadhavkar <[EMAIL PROTECTED]> wrote: > > Hi, > I took the following steps to get the customer sample working with MySQL > Used bin distro > 0) expand sample-customer.jar to get access to CustomersConfig.xml > 1) change CustomersConfig.xml to comment derby connection info and > uncomment mysql connection info (check for correct id, pwd, url, driver > class etc.) > 2) change build.xml to replace pathelement location from derby jar to > mysql jar (e.g.mysql-connector-java-5.0.4.jar) > 3) create sample-customer.jar to use the changed CustomersConfig.xml(remove > the one that comes from bin destro) > and put the new sample-customer.jar under directory customer/ > 4) place required mysql jar (e.g. mysql-connector-java-5.0.4.jar) under > directory customer/ > 5) with these changes - ant will locate mysql jar and new config xml > 6) now do ant from customer/ > > With this I could verify that mysql data is getting used in the sample. > run: > [java] ************* Initializing database ************* > [java] ** DB type : mysql > [java] ** Database : jdbc:mysql://localhost/dastest > [java] ** User : root > [java] ** Password : mypwd > [java] ************************************************ > [java] Setting up for mysql run! > [java] Dropping tables > [java] Dropping procedures > [java] Creating tables > [java] Creating procedures > [java] Inserting data in tables > [java] Database setup complete! > [java] > [java] Result:select all customers > [java] ID:1 LASTNAME:John ADDRESS:USA > [java] ID:2 LASTNAME:Amita ADDRESS:INDIA > [java] ID:3 LASTNAME:Patrick ADDRESS:UK > [java] ID:4 LASTNAME:Jane ADDRESS:UN > [java] > [java] Result:insert new customer > [java] ID:1 LASTNAME:John ADDRESS:USA > [java] ID:2 LASTNAME:Amita ADDRESS:INDIA > [java] ID:3 LASTNAME:Patrick ADDRESS:UK > [java] ID:4 LASTNAME:Jane ADDRESS:UN > [java] ID:5 LASTNAME:Jenny ADDRESS:USA > [java] > [java] Result:update first customer > [java] ID:1 LASTNAME:BlueBerry ADDRESS:USA > [java] ID:2 LASTNAME:Amita ADDRESS:INDIA > [java] ID:3 LASTNAME:Patrick ADDRESS:UK > [java] ID:4 LASTNAME:Jane ADDRESS:UN > [java] ID:5 LASTNAME:Jenny ADDRESS:USA > [java] > [java] Result:delete last customer > [java] Deleting customer named: Jenny > [java] ID:1 LASTNAME:BlueBerry ADDRESS:USA > [java] ID:2 LASTNAME:Amita ADDRESS:INDIA > [java] ID:3 LASTNAME:Patrick ADDRESS:UK > [java] ID:4 LASTNAME:Jane ADDRESS:UN > > Regards, > Amita > > On 9/14/07, Eborn, Eric D <[EMAIL PROTECTED]> wrote: > > > > It seems there is a new problem with Beta2, it follows the path of > > execution for a MySQL data base but then decides to connect to a derby > > db... > > > > Seems strange to me, likely a bug. > > > > > > BUILD SUCCESSFUL > > Total time: 1 second > > D:\data\eeborn\Desktop\tuscany-das-1.0-incubating-beta2\samples\customer > > >ant > > Buildfile: build.xml > > > > run: > > [java] ************* Initializing database ************* > > [java] ** DB type : mysql > > [java] ** Database : jdbc:mysql://localhost/dastest > > [java] ** User : dastest > > [java] ** Password : dastest > > [java] ************************************************ > > [java] Exception in thread "main" java.lang.NoSuchMethodError: > > org.apache.derby.jdbc.InternalDriver.embeddedDriverAcceptsURL(Ljava/lang > > /String;)Z > > > > [java] at > > org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source) > > [java] at > > java.sql.DriverManager.getConnection(DriverManager.java:582) > > [java] at > > java.sql.DriverManager.getConnection(DriverManager.java:154) > > [java] at > > org.apache.tuscany.samples.das.databaseSetup.DatabaseSetup.initConnectio > > n(DatabaseSetup.java:108) > > [java] at > > org.apache.tuscany.samples.das.databaseSetup.DatabaseSetup.<init>(Databa > > seSetup.java:66) > > [java] at > > org.apache.tuscany.samples.das.databaseSetup.MySQLSetup.<init>(MySQLSetu > > p.java:26) > > [java] at > > org.apache.tuscany.samples.das.customer.CustomerDatabaseInitializer.Init > > ialize(CustomerDatabaseInitializer.java:75) > > [java] at > > org.apache.tuscany.samples.das.customer.CustomerClient.main(CustomerClie > > nt.java:165) > > [java] Java Result: 1 > > > > BUILD SUCCESSFUL > > Total time: 0 seconds > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > >
