Received: from ns.crystaldonuts.com ([38.194.228.45]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eAGHhLs83356 for ; Thu, 16 Nov 2000 12:43:21 -0500 (EST) (envelope-from tony@uickarate.com) Received: (qmail 21685 invoked from network); 16 Nov 2000 17:41:51 -0000 Received: from unknown (HELO tonydesktop) (64.148.169.10) by 38.194.228.45 with SMTP; 16 Nov 2000 17:41:51 -0000 Message-ID: <009301c04fec$15835aa0$32fea8c0@tonydesktop> From: "tony" To: "Michael Stephenson" Cc: "pgsql-interfaces" References: Subject: Re: JDBC prob. Continued Date: Thu, 16 Nov 2000 11:41:33 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200011/186 X-Sequence-Number: 222 The host could be just localhost if this is running only on localhost, right? Or do I have to specify an IP? Thanks, Tony ----- Original Message ----- From: "Michael Stephenson" To: "tony" Cc: "pgsql-interfaces" Sent: Thursday, November 16, 2000 12:37 PM Subject: Re: [INTERFACES] JDBC prob. Continued > On Thu, 16 Nov 2000, tony wrote: > > > I'm using 7.0. > > Greg told me that SQLException is thrown by > > getConnection(); > > so I've changed by getConnection to > > DriverManager.getConnection("jdbc:postgresql:database_name", "postgres", > > "password"); > > and the error changed to something like this: > > SQLException: Connection refused. Check that th ehostname and port is > > correct, and > > tha thte postmaster is runing with the -i flag, which enables TCP/IP > > networking. > > > > Any ideas?? > > >From reading the error message I'd suggest, either you have the hostname > and port incorrect, correct use is: > > DriverManager.getConnection( > "jdbc:postgresql://[host]:[port]/[db_name]", > "[username]", "[password]"); > > Or you're not running postmaster with the -i flag, I use: > > postmaster -i -p [port] -D [data directory] > > If it's neither of those, then I'm sorry for being patronising. > > Hope this helps, > > Michael Stephenson > >