File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC 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
Bookmark "Loading Into Random Table" Watch "Loading Into Random Table" New topic
Author

Loading Into Random Table

vikram solanki
Greenhorn

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
Thanks
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31062
    
232

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Loading Into Random Table