This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating an MDB from the resultset

 
Surya Indukuri
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a requirement to connect to Access Database and execute query and with the Resultset create a table in another database(MDB).
Each query resultset should be populated to appropriate tables in the .MDB.

I do not know how I can create and populate a table from the resultset.Can somebody help me?
 
Scott Selikoff
author
Saloon Keeper
Posts: 3901
16
Eclipse IDE Flex Google Web Toolkit
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean when you say MDB?

As for your specific problem, you cannot usually convert the a result set directly into input to a new query, you have to break it up into multiple steps. First, perform the query, then read the results and save them in some container class or hash map. Then, construct a new set of queries based on your stored data including a single table creation statement, and execute these queries as insert statements.
 
Surya Indukuri
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MDB is Access DataBase.

I Just need to query and store the results in a table. Is there an easy way for me to store the results into the table other than looping thru in the while and inserting rows into the table?
 
Scott Selikoff
author
Saloon Keeper
Posts: 3901
16
Eclipse IDE Flex Google Web Toolkit
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just checking, to me MDB means message driven bean but thats because I haven't used access databases in ages.

You can break it up into separate steps and do a batch import. Store the retrieved data in an array of some container class, than use the container class to build a set of import statement (or one giant batch import).

If you're are looking for some auto-magical solution that will do all this for you, you'd need a more advanced technology like JDO. In JDBC everything is done via direct SQL or possibly with the help of stored procedures.
[ January 04, 2006: Message edited by: Scott Selikoff ]
 
Tom Blough
Ranch Hand
Posts: 263
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have access to Access and both MDB files, use import/link to add a symbolic link to one of the tables in the other database. You can then use a simple SQL to accomplish the task in the MDB that contains both the tables:



Cheers,
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic