Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / September 2004

Tip: Looking for answers? Try searching our database.

Synchronizing databases

Thread view: 
Ike - 26 Sep 2004 19:54 GMT
I have a MySql database I connect through using mysql-connector-...jar. I
need to co-exist with another MySql database in order to get this one job
wherein the fields of the other database can map to fields in my database.

For example, they have a customers table as does mine. There may be some
differences in the fields and such, but, in broad strokes, the tables are
redundant.

I cannot, however, rewrite this application to use their format - both
tables need to coexist. So I am wondering if there is not an accepted means
to monitor changes in one database/table and forward those changes to the
other database/table on an ongoing and real-time basis.

Does such a procedure exist? Thanks, Ike
David Harper - 26 Sep 2004 20:27 GMT
> I have a MySql database I connect through using mysql-connector-...jar. I
> need to co-exist with another MySql database in order to get this one job
[quoted text clipped - 10 lines]
>
> Does such a procedure exist? Thanks, Ike

If the table structures were *identical*, you could use replication.
Read the manual chapter here:

    http://dev.mysql.com/doc/mysql/en/Replication.html

However, in your case, the two tables are apparently not identical, so I
cannot recommend replication, because it has the potential to completely
screw the database which is the "backup copy". You'll have to update
both tables in your client code.

David Harper
Cambridge, England
Mykola Rabchevskiy - 28 Sep 2004 03:15 GMT
I uses simple java program which read batch file and perform mix of
SQL statements targeted to 2 different databases. Batch script contains
in addition to usual SQL statements a special database switch statement.
Data synchronization between tables witch different structure requires
may be done in a few steps using mySQL commands over JDBC:

 - select data into temp table;
 - save this temp table into text file;
 - insert data from text file into other database.

Of course, it is possible to use system scheduling tool to perform
batch processing automatically on regular basis.

Java program is very simple; I can send sources.

Regards

Mykola Rabchevskiy

> I have a MySql database I connect through using mysql-connector-...jar. I
> need to co-exist with another MySql database in order to get this one job
[quoted text clipped - 10 lines]
>
> Does such a procedure exist? Thanks, Ike


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.