Search code examples
javapostgresqljardriverschemaspy

Schema Spy unable to find postgresql driver


I want to use Schema Spy to generate schema diagrams,

I have specifed the following command

java -jar schemaSpy_5.0.0.jar -t pgsql -host 10.100.71.21[:5432] -db mydb -s public -u username -p password -dp postgresql-8.0-312.jdbc3.jar -o output/

I have the postgresql driver jar file in the same directory as schema spy jar file. But it gives the following error

[schemaSpy_5.0.0.jar]/net/sourceforge/schemaspy/dbTypes/pgsql.properties
java.lang.ClassNotFoundException: org.postgresql.Driver

Failed to load driver 'org.postgresql.Driver'from: [file:/home/panx/postgresql-8.0- 312.jdbc3.jar]
This entry doesn't point to a valid file/directory: [/whereever/postgresql-8.0-312.jdbc3.jar]

Use the -dp option to specify the location of the database
 drivers for your database (usually in a .jar or .zip/.Z).

Any help would be appreciated.

Thanks,

Pankaj


Solution

  • I think the problem is you didn't add the classpath to the driver. You have to add your classpath like this

    java -jar schemaSpy_5.0.0.jar -t pgsql -host 10.100.71.21[:5432] -db mydb -s public -u username -p password -dp /home/panx/postgresql-8.0-312.jdbc3.jar -o output/
    If it does not work you can download the source code of this project. In the project there is pgsql.properties file in dbTypes folder. You can change it with your classpath and I think this solves your problem.