473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

single Query for two databases located in different machine

2
Hi,

I need to use 2 MySQL databases in 2 different machines.
How to connect both databases using JDBC and get the two results same time using a single Query.

Any hints or examples would be highly appreciated.

Regards,
Nov 26 '07 #1
3 2196
r035198x
13,262 8TB
Hi,

I need to use 2 MySQL databases in 2 different machines.
How to connect both databases using JDBC and get the two results same time using a single Query.

Any hints or examples would be highly appreciated.

Regards,
Do you absolutely have to get the results using one query? You realize of course, that you need to have two connections set up with different connection strings? On which connection would you run the query then?
Nov 27 '07 #2
ktuhin
2
Do you absolutely have to get the results using one query? You realize of course, that you need to have two connections set up with different connection strings? On which connection would you run the query then?
hi. i need to query two databases in different server and display the result of both in one window.

In this case, I think I need one query if possible and run the query in 1st connection, right? Or if not possible, I can have two query at the same time.
please let me know your suggestion.
Nov 28 '07 #3
r035198x
13,262 8TB
hi. i need to query two databases in different server and display the result of both in one window.

In this case, I think I need one query if possible and run the query in 1st connection, right? Or if not possible, I can have two query at the same time.
please let me know your suggestion.
You can create a connection to the first database and get some results from there and store them into some structure, lists,map, or perhaps some user-defined datatype depending on the data that's returned. You then connect to the second database and do the same. You can then work on the results returned to come up with the desired output for your window.
Nov 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Benedictum | last post by:
How do I access data from a database located in a server somewhere with an application running on a local machine?
11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
8
by: Matt | last post by:
Hi everyone I was wondering if there was a way to disable a single database with having to shutdown mysql or rename tables? Thanks, Matt
20
by: xixi | last post by:
hi, we use db2 udb v8.1 on windows, i am trying to use federated database objects to create wrapper, even though i have update dbm cfg using federated yes, i still get error "the instance for the...
6
by: ats | last post by:
I have a table that contains the database names of external databases. Each one of these external databases contain a table (which has the same structure) that I would like to query together as one...
17
by: Michael C# | last post by:
Question - I keep getting the above error when I try to run an INSERT query against an Access database. I'm running XP Professional and VS.NET 2003. I run SELECT queries from ASP.NET against it...
9
by: noor.rahman | last post by:
I was wondering how it may be possible to query 2 MySQL databases using one query statement from PHP. For instance: SELECT database1.tableA.field1 UNION database2.tableB.field2. My concern...
7
by: Daz | last post by:
Hi. I am trying to select data from two separate MySQL tables, where I cannot use join, but when I put the two select queries into a single query, I get an error telling me to check my syntax. Both...
1
by: ljpitre | last post by:
I need to write a compound query to access two different SQL servers. When I specify the server name as a prefix to the database name i get syntax error. I can not seem to find any examples of how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.