pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Kirkbride <rob.kirkbride@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Data Migration
Date: Mon, 3 Sep 2007 09:52:25 +0100
Message-ID: <e0b3cb2b0709030152j325b68edsaf0701287ddc2004@mail.gmail.com> (raw)

Hi,

Is there a way in JDBC to move data from one database to another without
having to hard-wire the table structure?

I was wondering if I can do a kind of

ResultSet rs = executeStatement("select * from table (from connection 1)
where somecondition")
while (rs.next())
    take the resultset and then pass directly into a prepared statement for
an "insert into table" (from connection 2)

I can't see any way other disecting the values from the first query and
using getSQLType.

Any ideas?

Thanks

Rob

view thread (2+ messages)  latest in thread

Message-ID: <e0b3cb2b0709030152j325b68edsaf0701287ddc2004@mail.gmail.com>
Permalink:  ../e0b3cb2b0709030152j325b68edsaf0701287ddc2004@mail.gmail.com/
Also on:    postgresql.org/message-id/e0b3cb2b0709030152j325b68edsaf0701287ddc2004@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: rob.kirkbride@gmail.com
  Subject: Re: Data Migration
  In-Reply-To: <e0b3cb2b0709030152j325b68edsaf0701287ddc2004@mail.gmail.com>
  References: <e0b3cb2b0709030152j325b68edsaf0701287ddc2004@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