Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.databases Subject: Re: copy data from one database to another Date: Sat, 18 Aug 2012 11:09:18 -0700 Organization: albasani.net Lines: 30 Message-ID: References: <35bb23f9-03ca-41a3-9bba-0cd5ee0c3162@z20g2000prh.googlegroups.com> <057be9ae-208a-4601-a5b2-9ed8c64f5d9a@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net LPt7XlYIiw6ZIUvbFqESZVnO4XmgF0Mr47xOlBrS7Nkk75++QGKJg1ItLao8bYghKZvyFNdYG0et/bNDMr5AHqHyxpxeE5xa11OkkYQEuGUugZudKKfUbzT8VftyMNX1 NNTP-Posting-Date: Sat, 18 Aug 2012 18:09:08 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="LbtLGJfrkN/7qLuHjVfD2L3adXesshxXy0D87DDEKNXKxi+m+8RNoffAtvhUkxr2cQrFTOfSuP8Fqd0uuXPa1Iq9OZDrqRVhtIqc7IEMefr7MgNeDh2iEv482apo30SZ"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 In-Reply-To: <057be9ae-208a-4601-a5b2-9ed8c64f5d9a@googlegroups.com> Cancel-Lock: sha1:KwrsHPDn4sOqrVqxCO3vvD8DIAE= Xref: csiph.com comp.lang.java.databases:553 Sathish@myc2s.com wrote: > bazzer wrote: Is this a repost? >> I am trying to go about copying data from one database to another. The >> source database is SQL server, and the destination is an Oracle >> database. While I can access both database' fine, and insert into the >> oracle database fine, I am having trouble copying data from the SQL DB >> to the Oracle DB. What I was initially trying to do was copy all the >> required data into a resultSet, and then transfer this into the Oracle >> DB. But i probablt cannot insert this block of data in the resultSet >> directly into the Oracle db i supposed??? If anyone could suggest a >> better more efficient way to transfer the data i would be grateful. >> Please see below a snippet of the code for transferring the data. For >> the moment I am only copying rows between a certain timestamp. Its >> seems to run fine, and I am not getting an error, but when I check the >> Oracle database, there is no data in it. Using the source database's tools, export the source data to a format recognized by both RDBMSes, such as certain CSV formats. Using the destination database's tools, import the data from that format. If you must use Java, use 'PreparedStatement'. You might accidentally be performing a random SQL injection attack on yourself with the code you posted. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg