X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 57F2711F6AAF for ; Wed, 5 Apr 2006 16:02:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59343-01-5 for ; Wed, 5 Apr 2006 16:02:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.digitalfairway.ca (ns.digitalfairway.ca [207.164.133.170]) by postgresql.org (Postfix) with ESMTP id 0753E11F694D for ; Wed, 5 Apr 2006 16:02:51 -0300 (ADT) Received: from toronto.toronto.digitalfairway.ca (unknown [192.168.100.10]) by mail.digitalfairway.ca (Postfix) with ESMTP id E7424A0764 for ; Wed, 5 Apr 2006 15:02:49 -0400 (EDT) Received: from localhost (toronto.toronto.digitalfairway.ca [127.0.0.1]) by toronto.toronto.digitalfairway.ca (Postfix) with ESMTP id 98CD41398EE for ; Wed, 5 Apr 2006 15:02:49 -0400 (EDT) Received: from toronto.toronto.digitalfairway.ca ([127.0.0.1]) by localhost (toronto.toronto.digitalfairway.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 14819-07 for ; Wed, 5 Apr 2006 15:02:49 -0400 (EDT) Received: from [192.168.100.50] (unknown [192.168.100.50]) (using SSLv3 with cipher EXP1024-RC4-SHA (56/128 bits)) (No client certificate requested) by toronto.toronto.digitalfairway.ca (Postfix) with ESMTP id 76B58136DB9 for ; Wed, 5 Apr 2006 15:02:49 -0400 (EDT) From: Jan de Visser To: pgsql-jdbc@postgresql.org Subject: Re: I just can't use the org.postgresql.Driver class... Please help! Date: Wed, 5 Apr 2006 15:02:48 -0400 User-Agent: KMail/1.9.1 References: <3a829cca0604051153i71f8a212n5992243608f6f2cb@mail.gmail.com> In-Reply-To: <3a829cca0604051153i71f8a212n5992243608f6f2cb@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200604051502.48358.jdevisser@digitalfairway.com> X-Virus-Scanned: amavisd-new at digitalfairway.ca X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.083 required=5 tests=[AWL=0.083] X-Spam-Score: 0.083 X-Spam-Level: X-Archive-Number: 200604/47 X-Sequence-Number: 14981 On Wednesday 05 April 2006 14:53, Kamal wrote: > Simple log file making me crazy (javac.log): > > JasperReportsTest.java:6: unreported exception > java.lang.ClassNotFoundException; must be caught or declared to be > thrown > =A0 =A0Class.forName("org.postgresql.Driver"); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^ > 1 error > > Obviously the file postgresql-8.1-405.jdbc3.jar is there... > > Why does it say ClassNotFound if the file is there? Can anyone help me? > Thank you : ) Well, the class is there at *compile time*. What this is telling you is tha= t=20 at *runtime* Class.forName() will fail with that exception if the class is= =20 not available *at runtime*. You need to catch the exception, like so: try { Class.forName( "org.postgresql.Driver" ); } catch ( ClassNotFoundException cnfe ) { System.err.println( "driver not found!" ); } I would recommend an introductory Java text.=20 jan =2D-=20 =2D------------------------------------------------------------- Jan de Visser =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 jdevisser@digitalfair= way.com =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Baruk Khazad! Khazad ai-menu! =2D-------------------------------------------------------------