Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 6D8969FB1C6; Thu, 7 Jun 2007 11:25:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 95204-01-5; Thu, 7 Jun 2007 11:25:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from nihrelayxway2.hub.nih.gov (mailfwd.nih.gov [128.231.90.107]) by postgresql.org (Postfix) with ESMTP id 09F179FBADC; Thu, 7 Jun 2007 11:25:15 -0300 (ADT) X-IronPortListener: NIH_Relay X-SBRS: None X-IronPort-AV: E=Sophos;i="4.16,395,1175486400"; d="scan'208";a="301644215" Received: from pressa.nci.nih.gov (HELO [137.187.209.230]) ([137.187.209.230]) by nihrelayxway2.hub.nih.gov with ESMTP; 07 Jun 2007 10:25:14 -0400 Message-ID: <4668154A.3090105@mail.nih.gov> Date: Thu, 07 Jun 2007 10:25:14 -0400 From: Sean Davis User-Agent: Thunderbird 1.5.0.8 (X11/20060911) MIME-Version: 1.0 To: Loredana Curugiu CC: pgsql-jdbc@postgresql.org, pgsql-novice@postgresql.org Subject: Re: [NOVICE] Query with tables from 2 different databases in Java References: <1c23c8e70706070708m2f3be6f9o75571fd8a82ee390@mail.gmail.com> In-Reply-To: <1c23c8e70706070708m2f3be6f9o75571fd8a82ee390@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/26 X-Sequence-Number: 17088 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 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