-
1. Re: Reverse Engineering MySQL DataBase
gastaldi Sep 25, 2013 12:37 PM (in response to wilsondesenv)Hi Wilson,
This is clearly an exception for not finding the JDBC JAR. What is the correct folder you're referring to?
Best Regards,
George Gastaldi
-
2. Re: Reverse Engineering MySQL DataBase
wilsondesenv Sep 25, 2013 2:23 PM (in response to gastaldi)Hi George,
Whenever Forge comman-line asks me this:
[crmadm] crmadm $ generate-entities --url jdbc:mysql://localhost:3306/crmadm --driver com.mysql.jdbc.Driver --user root --password desenv --dialect org.hibernate.dialect.MySQLDialect
? Enter the path in the local file system to the jar file containing the JDBC driver. [null]
I have tried:
/Users/Wilson/.m2/repository/mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1.6.jar
C:\Users\Wilson\.m2\repository\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar
\Users\Wilson\.m2\repository\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar
And lately, I put the jar file inside the home folder of the project, and try this:
mysql-connector-java-5.1.6.jar
If I do not type in any path to the driver I get no error but just a message: Found 0 tables in datasource.
I did try a lot of stuff, search Google for some people having the same trouble, I too am impressed why it is not working... Using Windows 8 (Portuguese). Maybe the folders´ translation is messing up... Gonna check on that..
-
3. Re: Reverse Engineering MySQL DataBase
wilsondesenv Sep 25, 2013 6:40 PM (in response to wilsondesenv)Well, do not know what the heck I did. But it worked.
Using this: /Users/Wilson/.m2/repository/mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1.6.jar
And commenting in persistence.xml <!-- <property name="hibernate.hbm2ddl.auto" value="create-drop"/> -->
Also put the jar file inside FORGE_HOME/lib
Sincerely I do not know why it was not working and why it is working now. But it has generated the entities from the database.
Anyway thanks everyone.
-
4. Re: Reverse Engineering MySQL DataBase
gerry.matte Sep 26, 2013 12:36 AM (in response to wilsondesenv)Your paths must contain forward slases or dual backslashes. The first path you tried did not specify the drive and that may explain why it failed. The second and third attempt used single backslashes which java interprets as "escaped" characters rather than path separators. Your successful run was due to having the driver jar in Forge_Home/lib which made it accessible to forge since the driver was now on it's classpath. I keep my current mysql driver in c:/s/drivers/mysql.jar to make it easy to type without errors.