advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   TIP BANK
Browse DevX
Data Mover Example
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
 

How To Copy Database Data Using JDBC

Copying database data is a basic, yet endlessly complex task, because not all data copy operations are alike. But the sample database-copy classes you'll find here provide a basic template for nearly every type of copy you need to perform. 


advertisement
f you work with databases, you'll often need to copy data from one database to another. While that sounds like a straightforward task, it often involves more than just a straightforward copy. For example, you may need to move only part of the data, or to modify the data as it is copied. This article demonstrates a set of classes that perform basic database copies—moving tables from one database to another—using a simple application I've called a "data mover." While the example is only a starting point that shows how to copy an entire database, you'll see that you can modify the code to perform customized data copy and transformation operations, such as copying individual tables or specific table rows or columns based on your individual needs.


For novices, this article also serves as a good introduction to Java Database Connectivity (JDBC), by showing you how to perform the following JDBC tasks:

  • Open a connection to a database
  • Create and submit queries
  • Process ResultSets returned by queries
In addition to demonstrating the basic use of JDBC, this article also shows how to query a database and gather information about the database's structure. This allows the data mover utility to gather enough information about the database to be able to copy it. Here's the four-step process that the data mover follows:

It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com.
Already a member?



advertisement