Re: Query with tables from 2 different databases in Java

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Mark Lewis <mark(dot)lewis(at)mir3(dot)com>, Loredana Curugiu <loredana(dot)curugiu(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Re: Query with tables from 2 different databases in Java
Date: 2007-06-07 14:34:10
Message-ID: 162676.53375.qm@web31814.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-novice


--- Mark Lewis <mark(dot)lewis(at)mir3(dot)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.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bart Degryse 2007-06-07 14:57:49 Re: [NOVICE] Query with tables from 2 different databases inJava
Previous Message Sean Davis 2007-06-07 14:25:14 Re: [NOVICE] Query with tables from 2 different databases in Java

Browse pgsql-novice by date

  From Date Subject
Next Message Bart Degryse 2007-06-07 14:57:49 Re: [NOVICE] Query with tables from 2 different databases inJava
Previous Message Sean Davis 2007-06-07 14:25:14 Re: [NOVICE] Query with tables from 2 different databases in Java