I am writing an application to synchronize data between Oracle Database on a server and MS Access on a client machine. Should XML be used in this situation? If so, then how?

Surendra Chauhan

The answer depends upon the structure of the data to be synchronized. Do both the sides have same data structure? or is there significant difference in the data structure? For example, different table structure, data types etc.

XML can be used in any data transfer and synchronization. I am synchronizing data between an SQL server and an Oracle database. The use of XML is more appropriate if there is significant difference in the database schema and the way the data is represented between the two sides. Using the XSLT and style sheets it is easy to process and manipulate the data. But, handling the data through the utility is also a complex process. While there are good JDBC drivers and libraries available for an Oracle database, I am not aware if there are good drivers for Access database. Moreover, the Access database does not support the standard SQL.

The possible steps would be:

  • Write a data exporter and importer for Oracle side. The applications will connect to the database using the JDBC drivers, and export/import data in/from XML files. Oracle XML libraries will be useful here.
  • Do the transformations using an XSLT processor, such as xalan from Apache.
  • Import/export data on the Access database side. JDBC/ODBC driver may be useful. I have no exoperience with XML libraries for Access data, so can not answer this portion in detail.
  • If the database schema, or some of the table structures are same, it is better to use ODBC drivers to connect the client and the server to synchronize the data. In this case the possible steps would be:

  • Establish the connection to the Oracle database using the ODBC from the client side.
  • Map the tables from oracle database in the Access database using the remote connection.
  • Create queries to update/delete data.