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 2F2285282E for ; Mon, 20 Jun 2005 03:32:23 -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 62017-01 for ; Mon, 20 Jun 2005 06:32:19 +0000 (GMT) Received: from gatekeeper.yes2etl.com (unknown [202.88.179.103]) by svr1.postgresql.org (Postfix) with ESMTP id C43CC5280D for ; Mon, 20 Jun 2005 03:32:16 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by gatekeeper.yes2etl.com (8.12.10/8.12.10) with ESMTP id j5MEndeW028928; Wed, 22 Jun 2005 20:19:39 +0530 Received: from gatekeeper.yes2etl.com ([127.0.0.1]) by localhost (gatekeeper [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 28753-03; Wed, 22 Jun 2005 20:19:39 +0530 (IST) Received: from mtracks.yes2etl.com (yes2etl.com [10.1.2.53]) by gatekeeper.yes2etl.com (8.12.10/8.12.10) with ESMTP id j5MEnYCt028924; Wed, 22 Jun 2005 20:19:35 +0530 Received: from localhost (localhost [127.0.0.1]) by mtracks.yes2etl.com (8.12.10/8.12.10) with ESMTP id j5K6U2wW013190; Mon, 20 Jun 2005 12:00:02 +0530 Received: from mtracks.yes2etl.com ([127.0.0.1]) by localhost (mtracks [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 03864-08; Mon, 20 Jun 2005 12:00:01 +0530 (IST) Received: from [10.1.2.15] (pc-15.yes2etl.com [10.1.2.15]) by mtracks.yes2etl.com (8.12.10/8.12.10) with ESMTP id j5K6SW05012957; Mon, 20 Jun 2005 11:58:33 +0530 Message-ID: <42B661F6.4040009@yes2etl.com> Date: Mon, 20 Jun 2005 11:58:06 +0530 From: Minal User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Cc: project@yes2etl.com, "Shankaramurthy Chockalingam" Subject: JDBC Connectivity.. Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at @@NET_SUBDOMAIN@@.yes2etl.com X-Virus-Scanned: by amavisd-new at @@NET_SUBDOMAIN@@.@@NET_DOMAIN@@ X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/100 X-Sequence-Number: 13062 I am noting down the steps..which I performed during installation and for using JDBC.... 1. DO we have to use ./configure with-java ? because when I use that I get error that it failed. Is this the reason I am not able to eshtablish the connectivity... In O'reily book it is mentioned that we have to build the driver...How does one do that?? I have copied the postgresql driver in /usr/local/tomcat/common/lib directory.. also set the class path...restarted the tomcat and used the java file as shown below... 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 Am I going wrong anywhere??