What is the most efficient method of replicating data betwen databases using JDBC?
Location: http://www.jguru.com/faq/view.jsp?EID=464253 Created: Jul 29, 2001 Author: Surendra Chauhan (http://www.jguru.com/guru/viewbio.jsp?EID=45993) Question originally posed by sharad nangia (http://www.jguru.com/guru/viewbio.jsp?EID=82063 Within Java, the most efficient method would be, opening connections using the JDBC and inserting or updating the records from one database to the other database, but it depends upon the databases being replicated. If you are using Oracle databases, it has standard methods for replication, and you do not need the JDBC for the replication. Use snapshots like updateable and read-only. There are different kind of replication. Let us consider the most widely used ones: A) One Master – One slave I) If there is not a significant difference between the structure of the database tables, the following method would be useful. FromDatabase=A; ToDatabase=B 1) Open JDBC connections between the databases A and B. 2) Read a record (RA ) from A using an SQL quer