X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 603095282C for ; Thu, 16 Jun 2005 07:42:16 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10881-01 for ; Thu, 16 Jun 2005 10:42:07 +0000 (GMT) Received: from mail.jobflash.com (mail.jobflash.com [64.62.211.41]) by svr1.postgresql.org (Postfix) with ESMTP id 44E0552824 for ; Thu, 16 Jun 2005 07:42:06 -0300 (ADT) Received: from [192.168.2.22] (user-2ivflmq.dialup.mindspring.com [165.247.214.218]) by mail.jobflash.com (Postfix) with ESMTP id E4986420C5; Thu, 16 Jun 2005 03:42:07 -0700 (PDT) Message-ID: <42B1577D.3050102@jobflash.com> Date: Thu, 16 Jun 2005 03:42:05 -0700 From: Tom Arthurs User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: minalac@yes2etl.com Cc: List Subject: Re: Postgresql-JDBC connectivity References: <42B1205E.8060904@yes2etl.com> <42B15261.7050503@yes2etl.com> In-Reply-To: <42B15261.7050503@yes2etl.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/85 X-Sequence-Number: 13047 You need to put it in common/lib under jakarta's home directory. That's the only place the class loader can find it. Minal wrote: > I set the classpath, copied in the lib folder of web-inf. If I try to > run a simple java program shown below: > import java.sql.*; > > public class Example1 > { > public static void main(String[] argv) > { > System.out.println("Checking if Driver is registerd"); > try > { > Class.forName("org.postgresql.Driver"); > } > catch(ClassNotFoundException cnfe) > { > System.out.println("Couldn't find the Driver"); > cnfe.printStackTrace(); > System.exit(1); > } > System.out.println("registered the Driver OK, so lets make a > connection"); > Connection c = null; > try > { > c= > DriverManager.getConnection("jdbc:postgresql://localhost/trainneedcorp","postgres","admin"); > > } > catch(SQLException se) > { > System.out.println("Couldnt connect"); > se.printStackTrace(); > System.exit(1); > } > if(c != null) > System.out.println("WE CONNECTED"); > else > System.out.println("Reaching here is not done"); > } > } > I get the following error: > > java.lang.ClassNotFoundException: org.postgresql.Driver > at java.net.URLClassLoader$1.run(URLClassLoader.java:199) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:187) > at java.lang.ClassLoader.loadClass(ClassLoader.java:289) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) > at java.lang.ClassLoader.loadClass(ClassLoader.java:235) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at Example1.main(Example1.java:10) > > > Dave Cramer wrote: > >> Hi, >> >> How are you trying to connect, what is the error message, >> specifically which lib directory of jakarta did you copy it into? >> >> Dave >> On 16-Jun-05, at 2:46 AM, Minal wrote: >> >>> Hi... >>> I am novice user of Postgresql8.0.3. I managed to export the >>> database from sql server. We have all our application in JSP. I want >>> to install the org.postgresql.driver.. >>> I completed the following steps... >>> 1.Downloaded the jar file from http://jdbc.postgres.org >>> 2. Copied it in the lib folder of Jakarta.. >>> 3. Edited the pages to use the Driver..am still not able to connect... >>> >>> Where am I going wrong?? >>> Minalac >>> >>> ---------------------------(end of >>> broadcast)--------------------------- >>> TIP 5: Have you checked our extensive FAQ? >>> >>> http://www.postgresql.org/docs/faq >>> >>> >> >> > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > > >