Received: from smtp.myokay.net (db.myokay.net [195.211.211.74]) by hub.org (8.9.3/8.9.3) with SMTP id RAA24543 for ; Fri, 18 Feb 2000 17:34:17 -0500 (EST) (envelope-from ralf@lehmann.cc) Received: (qmail 16205 invoked for bounce); 18 Feb 2000 22:34:14 -0000 Received: from unknown (HELO lehmann.cc) (194.29.45.26) by smtp.myokay.net with SMTP; 18 Feb 2000 22:34:14 -0000 Message-ID: <38ADC886.196E0D3C@lehmann.cc> Date: Fri, 18 Feb 2000 23:32:38 +0100 From: Ralf Lehmann Reply-To: ralf@lehmann.cc X-Mailer: Mozilla 4.7 [de]C-NECCK (Win98; I) X-Accept-Language: de, en,en-US MIME-Version: 1.0 To: FloydS@4peakstech.com CC: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] Exception: java.sql.SQLException: No suitable driver References: <000501bf7a36$5ac759e0$9701a8c0@azoffice.4peakstech.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Floyd Shackelford schrieb: > > I am trying to write a jdbc application for the first time and I can't seem > to connect to the database. I think my code is write. I suspect that my > problem is in my run script. PrintJob is the name of the class I am running > which wants to access the database. Anyone have any suggestions? > > I am using the jdbc6.5-1.1.jar downloaded from the postgresql jdbc web site. > > here is the error I'm receiving: > > Exception: java.sql.SQLException: No suitable driver > java.sql.SQLException: No suitable driver > at java.sql.DriverManager.getConnection(DriverManager.java:111) > at java.sql.DriverManager.getConnection(DriverManager.java:134) > at PrintJob.ConnectDatabase(PrintJob.java:186) > at PrintJob.main(PrintJob.java:496) > > here is my run script: > > #! /bin/bash > > # NOTE > # The environment variable JDKTOP must be set to point > # to the top of the jdk directory before running this > # script > > CLASSPATH=.:$JDKTOP/lib:../jar/jdbc6.5-1.1.jar > > # the host name must be followed by a slash > DBURL=jdbc:postgresql://*.*.*.*/ > > DBUSER=****** > > # since the password is stored in this script, you want to insure > permissions > # are adequate to keep prying eyes away > DBPASSWD=******* > > # set VERBOSE to blank if you want to turn the PrintJob server's verbose > mode off > VERBOSE=-verbose > > cd ./class > > java -Djdbc.drivers=postgresql.Driver PrintJob -dburl $DBURL -dbuser > $DBUSER -dbpasswd $DBPASSWD $VERBOSE youre script looks good ! but the error you get is typical a problem to find no driver(wrong classpath or misplaced driver) call java with -verbose flag and check if anything from jdbc6.5-1.1.jar is loading. if not check again your classpath there must a mistake else look in the jdbc.jar and check if postgresql.Driver.class is in it and you have a path like postgresql/jdbc2 or postgresql/jdbc1 eqvivalent to your jdk i hope to solve your problem mfg ralf lehmann