Re: Data Migration

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Rob Kirkbride" <rob(dot)kirkbride(at)gmail(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Data Migration
Date: 2007-09-03 11:34:57
Message-ID: 46DBF161.8050701@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Rob Kirkbride wrote:
> 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.

That seems like the easiest solution to me. You can do it completely
dynamically with no hard-wired table structure using the metadata.

Perhaps you could do it with the JDBC 4 RowSet API? I haven't looked at
it in detail.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Pawel Cesar Sanjuan Szklarz 2007-09-03 12:48:12 Re: jdbc problem
Previous Message Rob Kirkbride 2007-09-03 08:52:25 Data Migration