8

I've just downloaded schemaspy and it is working perfectly apart from one thing. I always have to specify the path to the mysql connector with the -dp option.

If I don't specify it, I get this error:

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

Failed to load driver 'com.mysql.jdbc.Driver'
This entry doesn't point to a valid file/directory: [/mysql/mysql-connector-java-5.1.6-  bin.jar]

The path (symlink to /usr/share/java/mysql-connector-java-5.1.28.jar or whatever version you have) is:

/usr/share/java/mysql-connector-java.jar

And it is on the $CLASSPATH.

Also, don't expect -p prompt for a password.

pabloab
  • 37
  • 4
naomi
  • 1,934
  • 1
  • 14
  • 29
  • 2
    This is my guess, I'm a Perl person not really a Java one. /mysql/ etc. is hardcoded into schemaspy somewhere so that, if the class path is different, it will **always** need to be supplied. I'm using Linux Mint and currently I use -dp /usr/share/java/mysql-connector-java-5.1.16.jar for example. I keep all my schemaspy commands in a batch file, so this isn't too inconvenient now... – Hugh Barnard Oct 14 '12 at 15:48

3 Answers3

6

I do it this way.. Added this as parameter: -dp C:\apache-tomcat-6.0.37\lib\mysql-connector-java-5.1.10.jar kept my mysql driver in destined folder.

Worked for me.

Maulzey
  • 4,100
  • 5
  • 22
  • 30
0

I use SchemaSpy ,a java based application, aand store the params using File-> Store Parameters once and later i just load it whenever i need it by File -> Load Parameters. You can give a try.

Angelin Nadar
  • 8,944
  • 10
  • 43
  • 53
0

Create then a script with the java statement and save the path to the mysql-connector as an enviroment variable and pass it to the -dp.

I had the common issues about the mysql-connector and the dot executable file. It's not necessary to restart the machine if you pass the correct value to -gv, believe me. I've installed the Graphviz and found the mysql-connector performing a sorted search of *.jar files.

The following lines are how I executed the statement.

java 
-jar schemaSpy.jar 
-t mysql 
-o library 
-host localhost 
-db dummyDB 
-u user
-p user
-dp C:\Oracle\Middleware\Oracle_Home\oracle_common\modules\mysql-connector-java-commercial-5.1.22\mysql-connector-java-commercial-5.1.22-bin.jar 
-gv "C:\Program Files (x86)\Graphviz2.38"
Jcc.Sanabria
  • 629
  • 1
  • 12
  • 22