Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Insert a recordset from one MySQL database into another MySQL database with JDBC

Posted on 2002-07-01
4
Medium Priority
?
305 Views
Last Modified: 2012-05-04
I am not sure if this is possible, but I have 2 MySQL database connections and I want to take a recordset from one database and insert it into the other database connection without having to go through the recordset row by row and column by column.

Is it possible to insert a complete recordset with one statement?
0
Comment
Question by:bhadsock
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Expert Comment

by:erikjensen
ID: 7122021
Sorry there is no way to insert a complete recordset with one statement the only way is row by row.

I am not familiar with MySQL, is there not some way to write a script in MySQL to do the job?
0
 

Author Comment

by:bhadsock
ID: 7122082
In MySQL, you can create an SQL statement that will insert data from a SELECT statement from another database.  Below is the the SQL statement I used when both databases lived on the same server:

INSERT INTO Database1Name.TableName SELECT * FROM Database2Name.TableName WHERE Database2Name.TableName.FieldName = 'SomeCriteria'

But now, the 2 databases are on 2 different database servers and therefore 2 different JDBC connections and each database is not aware of the other.

Is there a way to execute a similar SQL statement to the one I used above across 2 database connections?
0
 

Accepted Solution

by:
erikjensen earned 800 total points
ID: 7122140
Not possible, since JDBC knows nothing about database names, looks like you're stuck whith the row by row method.
0
 
LVL 35

Expert Comment

by:girionis
ID: 8893671
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- points to erikjensen

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question