pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Cannot connect to remote database.
3+ messages / 2 participants
[nested] [flat]

* Cannot connect to remote database.
@ 2005-04-13 20:13  Kristina Magwood <kristina@nanometrics.ca>
  0 siblings, 1 reply; 3+ messages in thread

From: Kristina Magwood @ 2005-04-13 20:13 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

I am trying to connect to two psql databases at once using jdbc.
The first database is v7.3 running on Windows under Cygwin, the second is 
v8.01 on Windows both on the local LAN.
The pg_hba.conf files on both machines allow any machine on the LAN to 
access the database. 
People regularly access the v7.3 database from Crystal Reports, so I know 
it's available.

When I try to run the jar from the first machine, I am able to connect to 
the local database, but not the remote database.
The same thing happens when I try from the second machine.

The error is:
Backend start-up failed: FATAL: database "xxx" does not exist.
Where xxx is the name of the database on the remote server.
In other words, my program is only looking for databases on the local 
machine.

The code I use to connect is:

DriverManager.registerDriver(new org.postgresql.Driver());
String serviceArg = jdbc:postgresql:xxx//<ipAddress>/<port>;
m_conn = DriverManager.getConnection(serviceArg, m_userName, 
m_userPassword);

Any help will be greatly appreciated.

Kristina Magwood

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

* Re: Cannot connect to remote database.
@ 2005-04-13 20:47  Dave Cramer <pg@fastcrypt.com>
  parent: Kristina Magwood <kristina@nanometrics.ca>
  0 siblings, 1 reply; 3+ messages in thread

From: Dave Cramer @ 2005-04-13 20:47 UTC (permalink / raw)
  To: Kristina Magwood <kristina@nanometrics.ca>; +Cc: pgsql-jdbc

Shouldnt the url be jdbc:postgresql://<ipAddress>/<port>/xxx;

Dave
Kristina Magwood wrote:

>
> Hi,
>
> I am trying to connect to two psql databases at once using jdbc.
> The first database is v7.3 running on Windows under Cygwin, the second 
> is v8.01 on Windows both on the local LAN.
> The pg_hba.conf files on both machines allow any machine on the LAN to 
> access the database.
> People regularly access the v7.3 database from Crystal Reports, so I 
> know it's available.
>
> When I try to run the jar from the first machine, I am able to connect 
> to the local database, but not the remote database.
> The same thing happens when I try from the second machine.
>
> The error is:
> Backend start-up failed: FATAL: database "xxx" does not exist.
> Where xxx is the name of the database on the remote server.
> In other words, my program is only looking for databases on the local 
> machine.
>
> The code I use to connect is:
>
> DriverManager.registerDriver(new org.postgresql.Driver());
> String serviceArg = jdbc:postgresql:xxx//<ipAddress>/<port>;
> m_conn = DriverManager.getConnection(serviceArg, m_userName, 
> m_userPassword);
>
> Any help will be greatly appreciated.
>
> Kristina Magwood 


-- 
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561




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

* Re: Cannot connect to remote database.
@ 2005-04-13 20:49  Kristina Magwood <kristina@nanometrics.ca>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Kristina Magwood @ 2005-04-13 20:49 UTC (permalink / raw)
  To: pg@fastcrypt.com; +Cc: pgsql-jdbc

Yes!  It works.  Thank you, Dave and John.




Dave Cramer <pg@fastcrypt.com> 
04/13/2005 04:47 PM
Please respond to
pg@fastcrypt.com


To
Kristina Magwood <kristina@nanometrics.ca>
cc
pgsql-jdbc@postgresql.org
Subject
Re: [JDBC] Cannot connect to remote database.






Shouldnt the url be jdbc:postgresql://<ipAddress>/<port>/xxx;

Dave
Kristina Magwood wrote:

>
> Hi,
>
> I am trying to connect to two psql databases at once using jdbc.
> The first database is v7.3 running on Windows under Cygwin, the second 
> is v8.01 on Windows both on the local LAN.
> The pg_hba.conf files on both machines allow any machine on the LAN to 
> access the database.
> People regularly access the v7.3 database from Crystal Reports, so I 
> know it's available.
>
> When I try to run the jar from the first machine, I am able to connect 
> to the local database, but not the remote database.
> The same thing happens when I try from the second machine.
>
> The error is:
> Backend start-up failed: FATAL: database "xxx" does not exist.
> Where xxx is the name of the database on the remote server.
> In other words, my program is only looking for databases on the local 
> machine.
>
> The code I use to connect is:
>
> DriverManager.registerDriver(new org.postgresql.Driver());
> String serviceArg = jdbc:postgresql:xxx//<ipAddress>/<port>;
> m_conn = DriverManager.getConnection(serviceArg, m_userName, 
> m_userPassword);
>
> Any help will be greatly appreciated.
>
> Kristina Magwood 


-- 
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561

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


end of thread, other threads:[~2005-04-13 20:49 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-13 20:13 Cannot connect to remote database. Kristina Magwood <kristina@nanometrics.ca>
2005-04-13 20:47 ` Dave Cramer <pg@fastcrypt.com>
2005-04-13 20:49   ` Kristina Magwood <kristina@nanometrics.ca>

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