• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Duplicate Database tables creation

Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a 2 databases, the "Database1" does have 10 tables from which we are handling the search by entering the respective keyword for the respective table. "Database2" doesn't have those 10 tables that are in "Database1", but now I want to do a search for the same 10 tables in "Database1" in "Database2". There are 2 options here

(i) Either we need to create those 10 tables again in "Database2"
(ii) In "Database2" we connect to "Database1" to access those 10 tables

Please let me know how I can go about it , I feel that the first option is better? if there is any alternative please let me know.

Posts: 3752
Netbeans IDE Oracle Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd say the correct answer depends on what you need. If the ten tables should always have the same contents in both databases, then linking them together somehow would probably be a good idea. If the ten tables should be independent in both databases, then you'll certainly need to create them in the second database too.

Also consider that linking two databases together might bring issues with distributed transactions (these usually only appear when something gets wrong), and if the first database is down, your second database might not be fully functional due to the link.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!