OK - I've been trying to get a demo project created with AndroMDA using mySQL, 
and was getting stuck at maven create-schema. For the benefit of others, here 
is what I had to do...



FIRST thing I learned: you have to install the mySQL JDBC driver on JBoss 
according to these directions 
(http://dev.mysql.com/doc/connector/j/en/cj-jboss-config.html).  Don't foget to 
change you dbname, user, and pass in the sample XML to be that of YOUR 
installation.



My FIRST attempt at maven create-schema after the above installation used this 
config:



In my project's root dir, under the file project.properties



dataSource.name=MySQLDB

dataSource=java:/${dataSource.name}

...

dataSource.driver.jar=${env.JBOSS_HOME}/server/default/lib/mysql-connector-java-3.1.10-bin.jar

dataSource.driver.class=com.mysql.jdbc.Driver

dataSource.url=jdbc:mysql://localhost:3306/kDemo

dataSource.user=putDBUserNameHere

dataSource.password=putDBPasswordHere

...

sql.mappings=MySQL

...

hibernate.db.dialect=org.hibernate.dialect.MySQLDialect





but this resulted in:





BUILD FAILED

File...... C:homejkozjavakudzukDemomaven.xml

Element... ant:sql

Line...... 229

Column.... 62

java.sql.SQLException: No suitable Driver for 
jdbc:mysql://localhost:3306





Apparently, the "database name" MUST be part of the URL, so I changed 
project.properties above with



dataSource.url=jdbc:mysql://localhost:3306/[b]kDemo[/b]





THIS resulted in 



BUILD FAILED

File...... C:homejkozjavakudzukDemomaven.xml

Element... ant:sql

Line...... 229

Column.... 62

java.sql.SQLException: Unknown database 'kdemo'





I THEN went into the mySQL console, and manually created the database "kDemo".



Finally, I got:



create-schema:

execute-script:

    [sql] Executing file: 
C:homejkozjavakudzukDemocoretargetschema-create.sql

    [sql] [ERROR] Failed to execute: alter table 
BOOK2CONTENTS drop foreign key ENTRY_BOOK_FKC

    [sql] [ERROR] java.sql.SQLException: Table 
'kdemo.book2contents' doesn't exist

    [sql] [ERROR] Failed to execute: alter table 
BOOK2CONTENTS drop foreign key ADDRESS_BOOK_CONTENTS_FKC

    [sql] [ERROR] java.sql.SQLException: Table 
'kdemo.book2contents' doesn't exist

    [sql] [ERROR] Failed to execute: alter table 
BUSINESS_ENTRY drop foreign key BUSINESS_ENTRY_INHERITANCE_FKC

    [sql] [ERROR] java.sql.SQLException: Table 
'kdemo.business_entry' doesn't exist

    [sql] [ERROR] Failed to execute: alter table 
PERSONAL_ENTRY drop foreign key PERSONAL_ENTRY_INHERITANCE_FKC

    [sql] [ERROR] java.sql.SQLException: Table 
'kdemo.personal_entry' doesn't exist

    [sql] 9 of 13 SQL statements executed successfully

BUILD SUCCESSFUL





That is where I'm at right now.  I'm not sure about the "table doesn't exist" 
error, as they ARE created in the database.  I'm investingating the possibility 
of a CASE error (I've had problems before where table names are case sensitive, 
so I want to look at the schema created.



What I've learned, however, is that the mySQL JDBC jar does NOT have to be in 
the Maven repository, only in the JBoss lib dir.  A datasource has to be 
created, and the JDBC URL HAS to include a database name, but you have to 
MANUALLY create that database.  Doesn't appear that the scripts will do that 
for you?  I would have assumed it would have.



Any ideas/feedback?
_________________________________________________________
Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=2460#2460
Posting to http://forum.andromda.org/ is preferred over posting to the mailing 
list!


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to