Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 7BC799F9774 for ; Mon, 3 Sep 2007 05:52:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 75588-06 for ; Mon, 3 Sep 2007 05:52:26 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.187]) by postgresql.org (Postfix) with ESMTP id 6A89B9F955D for ; Mon, 3 Sep 2007 05:52:26 -0300 (ADT) Received: by rv-out-0910.google.com with SMTP id l15so837255rvb for ; Mon, 03 Sep 2007 01:52:25 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=oAX+/2oBvxo4KLklP7+p66lUklYc0oHINvSj9sI+IsMwDFj+LlvaCOCX0ijU2eSpgeDyXAVAjkD4rIWncYWcv3pYBTUEbFyttpiZRLC5NkUQ2Rd4WLK0EuD5ECturugB/Rl/Z3aIqsXglivJCetdJ9kjHEpoUq05Ju9jw80ltMw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=kjeixpGWrbGTbeug8OLNxOgGZVdPcQJUzrNgE2uYBCZONRWmtD1vQ6JJl9IO6U407+eLxo2b7I6E9c7KV5n0KaHO4tazz8l/s2hIX4dlMuJdFlunGOqE5Onfm147L9y9LjfcSYwJtavaDQswmOUaDMcGzakiT4tJvs3rtT2g3q0= Received: by 10.141.145.11 with SMTP id x11mr1874845rvn.1188809545229; Mon, 03 Sep 2007 01:52:25 -0700 (PDT) Received: by 10.140.251.21 with HTTP; Mon, 3 Sep 2007 01:52:25 -0700 (PDT) Message-ID: Date: Mon, 3 Sep 2007 09:52:25 +0100 From: "Rob Kirkbride" To: pgsql-jdbc@postgresql.org Subject: Data Migration MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8578_17974119.1188809545206" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/3 X-Sequence-Number: 17425 ------=_Part_8578_17974119.1188809545206 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_8578_17974119.1188809545206 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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


------=_Part_8578_17974119.1188809545206--