Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 77F269FBBE1; Thu, 7 Jun 2007 12:19:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 91122-07; Thu, 7 Jun 2007 12:19:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from interscan.indicator.com (mail.indicator.be [193.121.199.3]) by postgresql.org (Postfix) with ESMTP id DEC039FBEA7; Thu, 7 Jun 2007 12:19:21 -0300 (ADT) Received: from webaccess.indicator.be ([10.100.1.7]) by interscan.indicator.com with InterScan Message Security Suite; Thu, 07 Jun 2007 17:04:22 +0200 Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Thu, 07 Jun 2007 16:58:04 +0200 Message-Id: <4668390D.A3DD.0030.0@indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Thu, 07 Jun 2007 16:57:49 +0200 From: "Bart Degryse" To: , Subject: Re: [NOVICE] Query with tables from 2 different databases inJava References: <1c23c8e70706070708m2f3be6f9o75571fd8a82ee390@mail.gmail.com><46 68154A.3090105@mail.nih.gov> In-Reply-To: <4668154A.3090105@mail.nih.gov> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__PartA78084FD.0__=" X-imss-version: 2.047 X-imss-result: Passed X-imss-approveListMatch: *@indicator.be X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.308 tagged_above=0 required=5 tests=AWL=0.170, BAYES_50=0.001, FORGED_RCVD_HELO=0.135, HTML_MESSAGE=0.001, UNPARSEABLE_RELAY=0.001 X-Spam-Level: X-Archive-Number: 200706/29 X-Sequence-Number: 17091 --=__PartA78084FD.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Personally I have no good experiences with neither dblink nor dbi-link. They perferm only acceptably on very few records. My approach now is to use srf plperl functions. That approach requires you to have a reasonable knowledge of perl, but is in my experience the = fastest (or at least slow) one and certainly the most flexible one. >>> Sean Davis 2007-06-07 16:25 >>> Loredana Curugiu wrote: > Hi, >=20 > 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? Hi, Loredana. You can't execute a query that includes two different databases in postgresql. However, you may want to look at the dblink contributed module (in contrib/dblink in the postgresql source) that provides an extension to do this. I have no idea how this will behave in the context of a java client, though. Sean ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match --=__PartA78084FD.0__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
Personally I have no good experiences with neither dblink nor = dbi-link.
They perferm only acceptably on very few records.
My approach now is to use srf plperl functions. That approach = requires you
to have a reasonable knowledge of perl, but is in my experience the = fastest
(or at least slow) one and certainly the most flexible one.

>= ;>> Sean Davis <sdavis2@mail.nih.gov> 2007-06-07 16:25 = >>>
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?

Hi, = Loredana.  You can't execute a query that includes two different
da= tabases in postgresql.  However, you may want to look at the = dblink
contributed module (in contrib/dblink in the postgresql source) = that
provides an extension to do this.  I have no idea how this = will behave
in the context of a java client, though.

Sean

= ---------------------------(end of broadcast)---------------------------TIP 9: In versions below 8.0, the planner will ignore your desire = to
       choose an index scan if your = joining column's datatypes do not
       = match
--=__PartA78084FD.0__=--