File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Loading Into Random Table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Loading Into Random Table" Watch "Loading Into Random Table" New topic

Loading Into Random Table

vikram solanki

Joined: Dec 07, 2010
Posts: 12

Hi All,

I am stuck with a small problem here. This may even sound a little crazy but here it is...
I am trying to load some data into tables. I have the tables created and the data available in an xml. I even have a xml parser that gets me the data from the xml. But the problem is i do not know which coulmn may be present in which table. So is there any way
1. I could load the data into the database with only the column names? (please note that all the tables will have uniqe column names. None of the coulmns will be repeated.)
2. I could find the name of the table in which the column is present and then load the data into the DB.

Please let me know if you have any ideas
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

You could use ResultSetMetaData to learn about the columns. Or in some databases, such as Oracle, you can query another table to see which columns exist.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Loading Into Random Table
It's not a secret anymore!