pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JDBC prob.  Continued
8+ messages / 4 participants
[nested] [flat]

* JDBC prob.  Continued
@ 2000-11-16 16:23 tony <tony@uickarate.com>
  2000-11-16 16:31 ` Re: JDBC prob.  Continued tony <tony@uickarate.com>
  2000-11-16 17:37 ` Re: JDBC prob.  Continued Michael Stephenson <mstephenson@tirin.openworld.co.uk>
  2000-11-16 21:09 ` Re: JDBC prob.  Continued Christopher Farley <chris@northernbrewer.com>
  0 siblings, 3 replies; 8+ messages in thread

From: tony @ 2000-11-16 16:23 UTC (permalink / raw)
  To: pgsql-interfaces

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??

Thanks,

Tony

----- Original Message -----
From: "Peter Mount" <petermount@maidstone.gov.uk>
To: "'tony'" <tony@uickarate.com>; "pgsql-interfaces"
<pgsql-interfaces@postgresql.org>
Sent: Thursday, November 16, 2000 11:14 AM
Subject: RE: [INTERFACES] JDBC Problem


> What version of the driver are you using?
>
> Versions 6.5.x and earlier used postgresql.Driver but 7.0 onwards uses
> org.postgresql.Driver
>
> Peter
>
> --
> Peter Mount
> Enterprise Support Officer, Maidstone Borough Council
> Email: petermount@maidstone.gov.uk
> WWW: http://www.maidstone.gov.uk
> All views expressed within this email are not the views of Maidstone
Borough
> Council
>
>
> -----Original Message-----
> From: tony [mailto:tony@uickarate.com]
> Sent: Thursday, November 16, 2000 2:55 PM
> To: pgsql-interfaces
> Subject: [INTERFACES] JDBC Problem
>
>
> I have a problem with loading the JDBC Driver.
> So far, my java code does nothing but to load the driver, and
> it gives SQLException with message "No suitable driver".
> I made the postgresql.jar with
> >make jdbc2
> (because I am using jdk1.3)
>
> and I used
> >jar tf postgresql.jar
> to make sure that the driver was included.
> (postgresql/Driver.class)
>
> My CLASSPATH is following:
> :/usr/local/lib/postgresql.jar:/usr/local/jdk1.3/bin/:/home/tony/classes/
>
> I am trying to load the driver by doing
> >Class.forName("postgresql.Driver");
>
> This is under linux platform.  Please let me know what could be
> wrong if you see anything wrong.
>
>
> Thanks!
>




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: JDBC prob.  Continued
  2000-11-16 16:23 JDBC prob.  Continued tony <tony@uickarate.com>
@ 2000-11-16 16:31 ` tony <tony@uickarate.com>
  2 siblings, 0 replies; 8+ messages in thread

From: tony @ 2000-11-16 16:31 UTC (permalink / raw)
  To: pgsql-interfaces

BTW, I have PGOPT="i"
for postgresql.init already.


Tony

----- Original Message -----
From: "tony" <tony@uickarate.com>
To: "pgsql-interfaces" <pgsql-interfaces@postgresql.org>
Sent: Thursday, November 16, 2000 11:23 AM
Subject: [INTERFACES] JDBC prob. Continued


> 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??
>
> Thanks,
>
> Tony
>
> ----- Original Message -----
> From: "Peter Mount" <petermount@maidstone.gov.uk>
> To: "'tony'" <tony@uickarate.com>; "pgsql-interfaces"
> <pgsql-interfaces@postgresql.org>
> Sent: Thursday, November 16, 2000 11:14 AM
> Subject: RE: [INTERFACES] JDBC Problem
>
>
> > What version of the driver are you using?
> >
> > Versions 6.5.x and earlier used postgresql.Driver but 7.0 onwards uses
> > org.postgresql.Driver
> >
> > Peter
> >
> > --
> > Peter Mount
> > Enterprise Support Officer, Maidstone Borough Council
> > Email: petermount@maidstone.gov.uk
> > WWW: http://www.maidstone.gov.uk
> > All views expressed within this email are not the views of Maidstone
> Borough
> > Council
> >
> >
> > -----Original Message-----
> > From: tony [mailto:tony@uickarate.com]
> > Sent: Thursday, November 16, 2000 2:55 PM
> > To: pgsql-interfaces
> > Subject: [INTERFACES] JDBC Problem
> >
> >
> > I have a problem with loading the JDBC Driver.
> > So far, my java code does nothing but to load the driver, and
> > it gives SQLException with message "No suitable driver".
> > I made the postgresql.jar with
> > >make jdbc2
> > (because I am using jdk1.3)
> >
> > and I used
> > >jar tf postgresql.jar
> > to make sure that the driver was included.
> > (postgresql/Driver.class)
> >
> > My CLASSPATH is following:
> >
:/usr/local/lib/postgresql.jar:/usr/local/jdk1.3/bin/:/home/tony/classes/
> >
> > I am trying to load the driver by doing
> > >Class.forName("postgresql.Driver");
> >
> > This is under linux platform.  Please let me know what could be
> > wrong if you see anything wrong.
> >
> >
> > Thanks!
> >
>
>




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: JDBC prob.  Continued
  2000-11-16 16:23 JDBC prob.  Continued tony <tony@uickarate.com>
@ 2000-11-16 17:37 ` Michael Stephenson <mstephenson@tirin.openworld.co.uk>
  2000-11-16 16:41   ` Re: JDBC prob.  Continued tony <tony@uickarate.com>
  2 siblings, 1 reply; 8+ messages in thread

From: Michael Stephenson @ 2000-11-16 17:37 UTC (permalink / raw)
  To: tony <tony@uickarate.com>; +Cc: pgsql-interfaces

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??



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: JDBC prob.  Continued
  2000-11-16 16:23 JDBC prob.  Continued tony <tony@uickarate.com>
  2000-11-16 17:37 ` Re: JDBC prob.  Continued Michael Stephenson <mstephenson@tirin.openworld.co.uk>
@ 2000-11-16 16:41   ` tony <tony@uickarate.com>
  0 siblings, 0 replies; 8+ messages in thread

From: tony @ 2000-11-16 16:41 UTC (permalink / raw)
  To: Michael Stephenson <mstephenson@tirin.openworld.co.uk>; +Cc: pgsql-interfaces

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" <mstephenson@tirin.openworld.co.uk>
To: "tony" <tony@uickarate.com>
Cc: "pgsql-interfaces" <pgsql-interfaces@postgresql.org>
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
>
>




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: JDBC prob.  Continued
  2000-11-16 16:23 JDBC prob.  Continued tony <tony@uickarate.com>
@ 2000-11-16 21:09 ` Christopher Farley <chris@northernbrewer.com>
  2 siblings, 0 replies; 8+ messages in thread

From: Christopher Farley @ 2000-11-16 21:09 UTC (permalink / raw)
  To: tony <tony@uickarate.com>; +Cc: pgsql-interfaces

> so I've changed by getConnection to
> DriverManager.getConnection("jdbc:postgresql:database_name", "postgres",
> "password");

The above URL is not correct, it should be
jdbc:postgresql://localhost:5432/database_name

Note the two slashes after jdbc:postgresql:

I am not sure if localhost:5432 is required, but it won't hurt.

----
Christopher Farley
Northern Brewer / 1150 Grand Avenue / St. Paul, MN 55105
www.northernbrewer.com
     






^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* RE: JDBC prob.  Continued
@ 2000-11-17 07:23 Peter Mount <petermount@maidstone.gov.uk>
  0 siblings, 0 replies; 8+ messages in thread

From: Peter Mount @ 2000-11-17 07:23 UTC (permalink / raw)
  To: 'tony' <tony@uickarate.com>; pgsql-interfaces

Check that postgres is running, and with -i set. From your url, I'm assuming
that the application is running on the same box as postgres?

Peter

-- 
Peter Mount
Enterprise Support Officer, Maidstone Borough Council
Email: petermount@maidstone.gov.uk
WWW: http://www.maidstone.gov.uk
All views expressed within this email are not the views of Maidstone Borough
Council


-----Original Message-----
From: tony [mailto:tony@uickarate.com]
Sent: Thursday, November 16, 2000 4:23 PM
To: pgsql-interfaces
Subject: [INTERFACES] JDBC prob. Continued


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??

Thanks,

Tony

----- Original Message -----
From: "Peter Mount" <petermount@maidstone.gov.uk>
To: "'tony'" <tony@uickarate.com>; "pgsql-interfaces"
<pgsql-interfaces@postgresql.org>
Sent: Thursday, November 16, 2000 11:14 AM
Subject: RE: [INTERFACES] JDBC Problem


> What version of the driver are you using?
>
> Versions 6.5.x and earlier used postgresql.Driver but 7.0 onwards uses
> org.postgresql.Driver
>
> Peter
>
> --
> Peter Mount
> Enterprise Support Officer, Maidstone Borough Council
> Email: petermount@maidstone.gov.uk
> WWW: http://www.maidstone.gov.uk
> All views expressed within this email are not the views of Maidstone
Borough
> Council
>
>
> -----Original Message-----
> From: tony [mailto:tony@uickarate.com]
> Sent: Thursday, November 16, 2000 2:55 PM
> To: pgsql-interfaces
> Subject: [INTERFACES] JDBC Problem
>
>
> I have a problem with loading the JDBC Driver.
> So far, my java code does nothing but to load the driver, and
> it gives SQLException with message "No suitable driver".
> I made the postgresql.jar with
> >make jdbc2
> (because I am using jdk1.3)
>
> and I used
> >jar tf postgresql.jar
> to make sure that the driver was included.
> (postgresql/Driver.class)
>
> My CLASSPATH is following:
> :/usr/local/lib/postgresql.jar:/usr/local/jdk1.3/bin/:/home/tony/classes/
>
> I am trying to load the driver by doing
> >Class.forName("postgresql.Driver");
>
> This is under linux platform.  Please let me know what could be
> wrong if you see anything wrong.
>
>
> Thanks!
>



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* RE: JDBC prob.  Continued
@ 2000-11-17 07:27 Peter Mount <petermount@maidstone.gov.uk>
  0 siblings, 0 replies; 8+ messages in thread

From: Peter Mount @ 2000-11-17 07:27 UTC (permalink / raw)
  To: 'tony' <tony@uickarate.com>; Michael Stephenson <mstephenson@tirin.openworld.co.uk>; +Cc: pgsql-interfaces

If the host is localhost, then you don't need to supply the hostname in the
url.
Same goes for the port, if missing it defaults to 5432.

As for hostname/ip address, you can use either - it's only when dealing with
applets when this has to be precise.

Peter

-- 
Peter Mount
Enterprise Support Officer, Maidstone Borough Council
Email: petermount@maidstone.gov.uk
WWW: http://www.maidstone.gov.uk
All views expressed within this email are not the views of Maidstone Borough
Council


-----Original Message-----
From: tony [mailto:tony@uickarate.com]
Sent: Thursday, November 16, 2000 4:42 PM
To: Michael Stephenson
Cc: pgsql-interfaces
Subject: Re: [INTERFACES] JDBC prob. Continued


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" <mstephenson@tirin.openworld.co.uk>
To: "tony" <tony@uickarate.com>
Cc: "pgsql-interfaces" <pgsql-interfaces@postgresql.org>
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
>
>



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* RE: JDBC prob.  Continued
@ 2000-11-17 07:28 Peter Mount <petermount@maidstone.gov.uk>
  0 siblings, 0 replies; 8+ messages in thread

From: Peter Mount @ 2000-11-17 07:28 UTC (permalink / raw)
  To: 'Christopher Farley' <chris@northernbrewer.com>; tony <tony@uickarate.com>; +Cc: pgsql-interfaces

It doesn't hurt, but localhost:5432 is the default when those two parameters
are missing.

Peter

-- 
Peter Mount
Enterprise Support Officer, Maidstone Borough Council
Email: petermount@maidstone.gov.uk
WWW: http://www.maidstone.gov.uk
All views expressed within this email are not the views of Maidstone Borough
Council


-----Original Message-----
From: Christopher Farley [mailto:chris@northernbrewer.com]
Sent: Thursday, November 16, 2000 9:09 PM
To: tony
Cc: pgsql-interfaces
Subject: Re: [INTERFACES] JDBC prob. Continued


> so I've changed by getConnection to
> DriverManager.getConnection("jdbc:postgresql:database_name", "postgres",
> "password");

The above URL is not correct, it should be
jdbc:postgresql://localhost:5432/database_name

Note the two slashes after jdbc:postgresql:

I am not sure if localhost:5432 is required, but it won't hurt.

----
Christopher Farley
Northern Brewer / 1150 Grand Avenue / St. Paul, MN 55105
www.northernbrewer.com
     





^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2000-11-17 07:28 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-11-16 16:23 JDBC prob.  Continued tony <tony@uickarate.com>
2000-11-16 16:31 ` tony <tony@uickarate.com>
2000-11-16 17:37 ` Michael Stephenson <mstephenson@tirin.openworld.co.uk>
2000-11-16 16:41   ` tony <tony@uickarate.com>
2000-11-16 21:09 ` Christopher Farley <chris@northernbrewer.com>
2000-11-17 07:23 RE: JDBC prob.  Continued Peter Mount <petermount@maidstone.gov.uk>
2000-11-17 07:27 RE: JDBC prob.  Continued Peter Mount <petermount@maidstone.gov.uk>
2000-11-17 07:28 RE: JDBC prob.  Continued Peter Mount <petermount@maidstone.gov.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox