From: Richard Broersma Jr <rabroersma@yahoo.com>
To: Mark Lewis <mark.lewis@mir3.com>
To: Loredana Curugiu <loredana.curugiu@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Cc: pgsql-novice@postgresql.org
Subject: Re: Query with tables from 2 different databases in Java
Date: Thu, 7 Jun 2007 07:34:10 -0700 (PDT)
Message-ID: <162676.53375.qm@web31814.mail.mud.yahoo.com> (raw)
In-Reply-To: <1181225634.31471.387.camel@archimedes>
--- Mark Lewis <mark.lewis@mir3.com> wrote:
> On Thu, 2007-06-07 at 17:08 +0300, Loredana Curugiu wrote:
> > Hi,
> >
> > I need a query to use tables from 2 different databases and
> > that query to be executed from a .java file. What do you recommand?
> >
> > Thanks in advance!
> >
> >
> > Regards,
> > Loredana
> >
>
>
> Move the data to a single database, or else perform the query manually
> by pulling back the matching results from each database individually and
> then stitching them together.
if the two databases are part of the same cluster you can use DBLINK so that one database can see
the table of enterest from the other.
http://pgfoundry.org/projects/snapshot/
if the two databases are not contained in the same cluster you can use DBI-LINK.
http://pgfoundry.org/projects/dbi-link/
Then from java, you only have to perform a simple query from one database.
Regards,
Richard Broersma Jr.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: rabroersma@yahoo.com, mark.lewis@mir3.com, loredana.curugiu@gmail.com, pgsql-novice@postgresql.org
Subject: Re: Query with tables from 2 different databases in Java
In-Reply-To: <162676.53375.qm@web31814.mail.mud.yahoo.com>
References: <1181225634.31471.387.camel@archimedes> <162676.53375.qm@web31814.mail.mud.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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