pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julius Stroffek <julo@stroffek.net>
To: Mark Lewis <mark.lewis@mir3.com>
Cc: 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: Fri, 8 Jun 2007 10:18:55 +0200
Message-ID: <6ec50dfd0706080118u794797e9y4c21cb0d813da3ac@mail.gmail.com> (raw)
In-Reply-To: <1181225634.31471.387.camel@archimedes>
References: <1c23c8e70706070708m2f3be6f9o75571fd8a82ee390@mail.gmail.com>
	<1181225634.31471.387.camel@archimedes>

Hi Mark,

You can use JTA - Java Transaction API to encapsulate transaction atomicity
across different databases (and database vendors).

XADatasource, XAConnection, XAResource are objects you should be looking
for. A couple of links about the issue:

http://java.sun.com/products/jta/
http://java.sun.com/developer/EJTechTips/2005/tt0125.html#1
http://www.java-tips.org/java-ee-tips/enterprise-java-beans/introduction-to-the-java-transactio.html

However, I do not know how postgres sql driver implements those interfaces.

Regards,

Julius Stroffek

On 6/7/07, 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.
>
> -- Mark Lewis
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>

view thread (12+ messages)  latest in thread

Message-ID: <6ec50dfd0706080118u794797e9y4c21cb0d813da3ac@mail.gmail.com>
Permalink:  ../6ec50dfd0706080118u794797e9y4c21cb0d813da3ac@mail.gmail.com/
Also on:    postgresql.org/message-id/6ec50dfd0706080118u794797e9y4c21cb0d813da3ac@mail.gmail.com

 · 

reply

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: julo@stroffek.net, 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: <6ec50dfd0706080118u794797e9y4c21cb0d813da3ac@mail.gmail.com>
  References: <1c23c8e70706070708m2f3be6f9o75571fd8a82ee390@mail.gmail.com> <1181225634.31471.387.camel@archimedes> <6ec50dfd0706080118u794797e9y4c21cb0d813da3ac@mail.gmail.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