Page 1 of 1

Connect to multiple datasources

Posted: Tue Dec 15, 2009 7:46 pm
by jza
is it possible to connec tto multiple databases in JDBC/OOo?

I got a client that has a sistem that uses MSQuery (an excel subset of db connectivity) and pull info from different databases and dump it into Excel. I wonder if Calc can do the same, the main question is if the datasource can connect from different datasources.

I know I can register multiple datasources but I am not sure I can connect to them simultaneously, but then again I have never tried and wonder if anyone else here knows.

Re: Connect to multiple datasources

Posted: Tue Dec 15, 2009 9:14 pm
by rudolfo
As far as I know MS Query is only a tool that binds a SQL query statement to an ODBC database connection. It can be used in MS Excel, but also in MS Access. Typically you use it in Excel to pull n x m table data from a data source into a spreadsheet.
The database connection is only used while the the data is extracted from the database. Depending on the amount of data this is mostly done in less than 2 or 3 seconds. (And even if it takes longer you will see the hourglass pointer and all further data input is blocked). In other words if you have 2 or 3 queries stored in the MS Query builder and you use them in MS Excel, they are actually used sequentially and not in parallel.
Right, at the end you will have the data from all the data sources in your spreadsheet (in parallel), but this is cached data.

You can do the same in Calc with some manually composed macros as in this other thread or there is also a more user friendly method to do this. I am not aware right now where I exactly saw this, but you might search in the Calc and Base forums for post with the keywords "insert from a database table".

Re: Connect to multiple datasources

Posted: Tue Dec 15, 2009 9:36 pm
by rudolfo
Okay,
I found what I had in mind: Open xls and keep ODBC query talks about the same problem ... and has a solution.