X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 0F7CA9FB25D for ; Sun, 30 Apr 2006 17:14:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 97998-06 for ; Sun, 30 Apr 2006 17:14:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.jay.net (mail.jay.net [81.19.224.84]) by postgresql.org (Postfix) with ESMTP id D6FF19FB263 for ; Sun, 30 Apr 2006 17:14:03 -0300 (ADT) Received: (qmail 27771 invoked by uid 509); 30 Apr 2006 20:13:59 -0000 Received: from 81.7.181.42 by mail.jay.net (envelope-from , uid 502) with qmail-scanner-1.24st (clamdscan: 0.87.1/635. spamassassin: 3.1.1 perlscan: 1.24st. Clear:RC:1(81.7.181.42):. Processed in 0.20512 secs); 30 Apr 2006 20:13:59 -0000 Received: from unknown (HELO server002.befree.dk) ([81.7.181.42]) (envelope-sender ) by mail.jay.net (qmail-ldap-1.03) with SMTP for ; 30 Apr 2006 20:13:59 -0000 Received: from Snake.localdomain ([83.94.135.5]RDNS failed) by server002.befree.dk with InterScan Messaging Security Suite; Sun, 30 Apr 2006 22:10:20 +0200 Message-ID: <4451F6B7.6080009@timmy.dk> Date: Fri, 28 Apr 2006 13:04:23 +0200 From: "Mads N. Vestergaard" User-Agent: Thunderbird 1.5 (X11/20060113) To: Oliver Jowett References: <4450B6E2.3020503@timmy.dk> <4450C7C4.7000503@timmy.dk> <4450CB39.1070205@timmy.dk> <37D75CA0-89B0-45F4-B183-88F06B3A3304@fastcrypt.com> <4451DC55.70409@timmy.dk> <4451E889.4070004@opencloud.com> <4451E911.7010905@timmy.dk> <4451ED79.6020000@opencloud.com> In-Reply-To: <4451ED79.6020000@opencloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: binary Resent-Date: Sun, 30 Apr 2006 22:14:17 +0200 Resent-From: Mads N. Vestergaard Subject: Re: java.sql.SQLException: No suitable driver Resent-Message-ID: <20060430221417.23512254@Snake.localdomain> Resent-To: pgsql-jdbc@postgresql.org X-imss-version: 2.038 X-imss-result: Passed X-imss-approveListMatch: *@timmy.dk X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/194 X-Sequence-Number: 15128 Hi Oliver... That seems to work just perfectly.... Oliver Jowett wrote: > Mads N. Vestergaard wrote: >> Hi Aliver, >> >> there isn't any conditional files in the environment variable CLASSPATH, >> and the program runs fine, it just can't connect to the database. > > I am talking about both the CLASSPATH environment variable and the -cp > command line argument. In my experience, if you specify -jar, both are > ignored and classes are only loaded from the standard locations, and > the single jarfile parameter given to -jar ("program.jar" in your case). > > Have you tried the command line I suggested? > >>> java -cp /usr/share/java/pg74.216.jdbc3.jar:program.jar >>> ProgramMainClass > > Please try this and let us know if it works. > > I would also suggest that silently ignoring ClassNotFoundException, as > the code you originally posted does, is a Really Bad Idea. That code > is masking the real source of the error: namely, that the driver > classes are *not* in your classpath. > > -O > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq