• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access Database Dump

 
Charles Z Martin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What I'm trying to accomplish is to dump an entire database table using a ResultSet.

The problem I'm facing is that the code should be generic for various tables such that no matter the amount of rows or columns it should just dump the entire table.

The dataset used is somewhat arbitrary.
 
Santhosh Kumar
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JDBC provides a vendor neutral way to access the database metadata, with which you can implement what you looking for. Check out this article for more info.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4007
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the built-in database export/import commands (or in the case of Access, copy the file). There's no such tool that will magically dump your database into a file format because database organization may be extremely complicated, especially the more your data is normalized.

For example, let says instead of US States in an address table, you have a StateId which refers to a record in a States table. How should such data be dumped? Should the Address print "New York City, 19" or "New York City, NY" which the ID resolved? You'd probably want the second one, but computer dumps aren't smart enough to handle such a case naturally. In other words, databases are structured and dumps (or flat files) are not, therefore the process of developing a 1-to-1 mapping is non-trivial unless you rely on built-in SQL commands
 
Charles Z Martin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just implemented it myself, accessing the DB metadata gave me exactly what I wanted. luckily I did not really need to do anything with that data, just print it out in a user friendly manner.

Thanks to all who replied!
 
Scott Selikoff
author
Saloon Keeper
Posts: 4007
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case what you were doing is really a SQL Projection, not a Dump (dump implies you want 100% of the data in a machine-readable format).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic