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 643A1D1CC9C for ; Fri, 4 Jun 2004 21:17:39 -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 98397-07 for ; Sat, 5 Jun 2004 00:17:38 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 4382CD1C943 for ; Fri, 4 Jun 2004 21:17:32 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i550HTDe095102 for ; Sat, 5 Jun 2004 00:17:32 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i55018V2090758 for pgsql-jdbc@postgresql.org; Sat, 5 Jun 2004 00:01:08 GMT From: brijesh@divinetaccess.com (brijesh) X-Newsgroups: comp.databases.postgresql.interfaces.jdbc Subject: Postgre not able to connect Date: 4 Jun 2004 00:31:48 -0700 Organization: http://groups.google.com Lines: 69 Message-ID: <7bccde45.0406032331.200f1039@posting.google.com> References: <20040414215304.243bc14e.ed@ednevitible.co.uk> <7bccde45.0405072248.430478c4@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-jdbc@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.4 tagged_above=0.0 required=5.0 tests=DATE_IN_PAST_12_24 X-Spam-Level: X-Archive-Number: 200406/29 X-Sequence-Number: 10231 try downloading the jar file from http://jdbc.postgresql.org/download.html and set tcp/ip connection = true in postgresql.conf file i have tried it out and was successful copy the postgresql.jar file into the j2sdk/lib folder set the class path to j2sdk/lib/postgresql.jar in you bash profile for root and your login i did it and am currently am working on it all the best > ed@ednevitible.co.uk wrote in message news:<20040414215304.243bc14e.ed@ednevitible.co.uk>... > > Hello I have downloaded the postgre driver for java, and tried to run > > the following code; > > > > import java.io.*; > > import java.sql.*; > > > > public class DataBase > > { > > > > > > public static void main(String args[]) > > { > > try { > > Class.forName("org.postgresql.Driver"); > > } catch (ClassNotFoundException cnfe) { > > System.err.println("Couldn't find driver class:"); > > cnfe.printStackTrace(); > > } > > > > > > System.out.println("Testing"); > > } > > } > > > > > > However, I get this output: > > ed@desktop:~/jbproject$ javac Example1.java && java Example1 > > Checking if Driver is registered with DriverManager. > > Couldn't find the driver! > > Let's print a stack trace, and exit. > > 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) > > > > The driver is there, after reading the documentation I thought, perhaps > > I have to rename the .jar file to postgres.jar: > > > > ed@desktop:/usr/lib/j2sdk1.4.2$ find . | grep postgres > > ./jre/lib/ext/postgresql.jar > > ./lib/postgresql.jar > > > > I am very confused as to what is going wrong. > > > > ---------------------------(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