Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 21DBB632BBE for ; Thu, 2 Sep 2010 13:05:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 54940-09 for ; Thu, 2 Sep 2010 16:05:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id C8B9763265B for ; Thu, 2 Sep 2010 13:05:06 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OrCHg-0004zD-15 for pgsql-jdbc@postgresql.org; Thu, 02 Sep 2010 18:05:04 +0200 Received: from 109.255.214.222 ([109.255.214.222]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Sep 2010 18:05:04 +0200 Received: from kyranoreilly by 109.255.214.222 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Sep 2010 18:05:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Kyran O Reilly Subject: Re: Can't connect to posgresql through the jdbc driver Date: Thu, 2 Sep 2010 15:41:20 +0000 (UTC) Lines: 55 Message-ID: References: <759461.26544.qm@web35603.mail.mud.yahoo.com> <4B8DB392.2020608@postnewspapers.com.au> <748530.91320.qm@web35603.mail.mud.yahoo.com> <4B8DD56F.9040109@postnewspapers.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 109.255.214.222 (Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100723 Fedora/3.6.7-1.fc13 Firefox/3.6.7) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.736 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_NUMERIC_HELO=1.164, T_FILL_THIS_FORM_SHORT=0.01, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/5 X-Sequence-Number: 20875 Thomas Kellerer gmx.net> writes: > > Craig Ringer, 03.03.2010 04:20: > >> I set it to the jar file as written above > > > > No, you didn't. You set it to the folder CONTAINING the jar. Try: > > > > CLASSPATH=$CLASSPATH:/opt/PostgreSQL/pgJDBC/postgresql-8.4-701.jdbc.jar > > > >> I am using netbeans 6.8 ... The project I chose was a java application . The application is supposed to > connect to a database which parameters (DB name , userName,Password ) I pass through netbeans config file > option (under the "run" section in the menu. I also tried to run it manually with this line: > > > > Eh? If you're using NetBeans, why are you messing with the CLASSPATH > > environment variable? > > Actually nowadays one should never use a system wide CLASSPATH, because it simply leads to a lot of problems. > > Either the IDE manages that or the classpath is defined using the -cp parameter when starting the Java > program. Or - most user-friendly - create an executable jar file that defines all needed libraries. > > Thomas > Using NetBeans 6.9.1 2 Steps 1) Tools -> Libraries. Scroll down on left side of window. Select Postgresql and on the right Click Add Jar or Folder and point it to the jar file. Click OK. 2) Within the project you are working on, in the Projects tab on the left hand sidee of the window, right click the project you want and choose Properties. Click Libraries choice (under Categories.) On right hand side on the Compile tab click the add library button and choose Postgresql. Click add library. Click OK. Now it should find and load Driver. All the Best Kyran