95 questions
40
votes
4
answers
118k
views
Querying multiple databases at once
I have WordPress instances with each in its own database. For an update I need to query all active plugins, that are stored in a table 'wp_options' and accessible via
WHERE option_name='...
45
votes
6
answers
109k
views
How to run the same query on all the databases on an instance?
I have (for testing purposes) many dbs with the same schema (=same tables and columns basically) on a sql server 2008 r2 instance.
i would like a query like
SELECT COUNT(*) FROM CUSTOMERS
on all DBs ...
69
votes
4
answers
99k
views
How to use 2 or more databases with spring?
I have an application that runs Spring MVC.
I need it to access 2 different databases in my app (one is a PostgreSQL and the other one is a MySQL database).
How do I configure this using just ...
58
votes
8
answers
54k
views
Django - how to specify a database for a model?
Is there a way to specify that a model (or app, even) should only ever use one particular database?
I am working with a legacy database that I don't want to change. I have two databases - the '...
16
votes
5
answers
26k
views
How to use multiple databases dynamically for one model in CakePHP
Ok, my first question was modified so many times that I chose to delete it and reformulate my question. I've made a small test-case project with different model-names to find a proper solution for my ...
28
votes
3
answers
21k
views
Making an Entity Framework Model span multiple databases
Is it valid to do something such as
CREATE SYNONYM [dbo].[MyTable] FOR [AnotherDatabase].dbo.[MyTable]
and then modify Entity Framework's edmx file to read this object like it would any other table?...
42
votes
3
answers
15k
views
Can multiple (two) persistent stores be used with one object model, while maintaining relations from one to the other?
Introduction
My iOS project ships with a Core Data persistent store weighing some 160MB in SQLite format. There is a ton of grouped information in there, in which users should be able to mark ...
36
votes
4
answers
46k
views
How to configure transaction management for working with 2 different db in Spring?
I have 2 databases (MySql and HSQLDB). I configured 2 data sources and 2 EntityManagerFactory beans. I can also configure 2 correspondent JpaTransactionManager beans.
But I don't know how to specify ...
19
votes
1
answer
7k
views
Django Multiple Databases Fallback to Master if Slave is down
I have master - slave replication setup for MySQL db backend for Django.
Currently I am reading and writing for Master DB only, but my dashboards are quite query intensive.
I was searching for an ...
8
votes
1
answer
14k
views
Join tables in two databases using SQLAlchemy
I am working with two MySQL Databases. I want to join a table from DB 1 with a table from DB2 in SQLAlchemy.
I am using automap_base while creating data access layer in sqlalchemy as follows...
...
8
votes
5
answers
11k
views
Migrating multiple databases using doctrine2 with Symfony2
I have 2 databases db1 and db2 in symfony2 + doctrine2 and both databases are different from each other in terms of tables and their fields.
I need to work on migration. Things work fine as long as ...
7
votes
2
answers
19k
views
Join query of two databases in codeigniter
I need to write a join query of two tables from two databases and fetch the joined data.
For eg, consider I have a database db1 which has some tables named companies, plans, customers. Suppose I need ...
6
votes
7
answers
17k
views
Multiple database connection in Rails
I'm using active_delegate for multiple connection in Rails. Here I'm using mysql as master_database for some models,and postgresql for some other models.
Problem is that when I try to access the ...
6
votes
4
answers
19k
views
MySQL Multiple Database Setup
I've searched for an answer to this and all I can seem to find are questions asking whether it is better to use multiple databases or multiple tables in a single database. This isn't my question ...
6
votes
1
answer
13k
views
liquibase using maven with two databases does not work
This post describes how to update two databases from maven using liquibase:
liquibase using maven with two databases
However, when I try the exact same configuration in my pom.xml (included below) it ...
1
vote
4
answers
10k
views
Codeigniter - multiple database connections
I have a problem with multiple db connections at Codeigniter. At my database.php i configured two databases.
$active_group = 'cms';
$active_record = FALSE;
$db['cms']['hostname'] = 'localhost';
...
20
votes
3
answers
178k
views
How to execute a SELECT query on one database containing a WHERE IN subquery to be executed on another database using CodeIgniter?
I have a problem with my query and I need to join two tables from different databases now my problem is how can I execute my query. I got my syntax format from here
I'm using CodeIgniter and here is ...
9
votes
4
answers
31k
views
CodeIgniter: Multiple Databases - Accessing database config in a second database
I've been looking into using multiple databases with CodeIgniter. If I know what the databases are ahead of time, then I can set the information in the config file and then call whichever database ...
9
votes
1
answer
7k
views
multi-tenant database architecture [closed]
I am building a SAAS application and we are discussing about one database per client vs shared databases. I have read a lot, incluisve some topics here at SO but I have still many doubts.
Our ...
9
votes
3
answers
10k
views
EF Code First Migration with Multiple Database / DbContext
I have two database each with their own dbcontext. I've setup two migration configurations. I can add a migration for the first db ust fine (Add-Migration DB1_InitialCreate -ConfigurationTypeName ...
6
votes
2
answers
23k
views
How to Merge Multiple Database files in SQLite?
I have multiple database files which exist in multiple locations with exactly similar structure. I understand the attach function can be used to connect multiple files to one database connection, ...
3
votes
2
answers
7k
views
Is it possible to have multiple core data "databases" on one iOS app?
I'm wanting to write a "management" game that utilizes Core data heavily. The game requires a pre-set, pre-defined dataset that cannot be changed by the user/system; it is used to seed the game with ...
3
votes
2
answers
9k
views
Spring + Hibernate + JPA + multiple databases
I have a Spring + Hibernate + JPA app. The user, when logging in, can choose from a list of DB's to connect to (these are the requirements). All the DB's have the same schema, so the same entities and ...
2
votes
2
answers
21k
views
Copying worksheets from multiple workbooks into current workbook
Copying worksheets from multiple workbooks into current workbook
Hi I was wondering if anybody if you guys could help me out?
Im trying to copy multiple workbooks and just save it into only one ...
1
vote
3
answers
2k
views
How to retrieve data from multiple Stata files?
I have 53 Stata .dta files each of them is 150 - 200 Mb and contain identical set of variables, but for different years. It is not useful to combine or merge them due to their size .
I need to ...
18
votes
6
answers
53k
views
How to create multiple database connections for different databases in java
I have an application which uses four databases in different geographical locations. All the databases contains same tables and only the database name is different according to the location.
I have to ...
14
votes
1
answer
20k
views
Spring: HibernateTransactionManager handling multiple datasources
In the following piece of code (Spring 3):
@Transactional("txManager")
public class DaoHolder {
@Transactional(value="txManager", readOnly=false, propagation=Propagation.REQUIRES_NEW, ...
13
votes
2
answers
13k
views
What is the correct way of Multiple inheritance in Qt/C++?
In my Qt application, I have a base class as follow. I am using QObject because I want to use Signal-Slot mechanism in all derived classes.
class IRzPlugin : public QObject {
public:
virtual void ...
12
votes
1
answer
9k
views
Using Multiple Databases Within CodeIgniter
SCENARIO: I'm building a web application that uses ion_auth to manage all of the user/administrator information (uses MySQL database), and each user has their own database (MySQL as well) for core ...
11
votes
1
answer
11k
views
Dynamic JPA Connection
I have a fairly standard Java EE6 web application using JPA 2 with dependency injection connecting to a MySQL database and everything is working fine. What I would like to do now is have this ...
10
votes
4
answers
2k
views
.NET migrations: Setup and migrate multiple databases at runtime
Brief introduction:
I have this ASP.NET Webforms site with the particularity that it doesn't have only 1 database, it has many.
Why? Because you can create new "instances" of the site on-the-fly. ...
8
votes
2
answers
1k
views
Django TestCase not using transactions on secondary database
I am using Django 1.3.1. I have two databases, some of my models live in one database, some in the other. Both databases are contrib.gis.db.backends.postgis databases.
To my surprise, Django's ...
7
votes
2
answers
20k
views
Connect multiple databases dynamically in laravel [duplicate]
I'm building an application which requires connecting 2 database. first one is static and another one is dynamic.
config/database.php is like
'mysql' =>
array (
'driver' => 'mysql',
'host' ...
7
votes
2
answers
7k
views
Connecting to two databases Mongoid
I have two databases that I have to use in my application. I have the following in my mongoid.yml:
development:
# Configure available database sessions. (required)
sessions:
# Defines the ...
4
votes
2
answers
4k
views
How to use DB router in Django 1.4
I've been trying to setup Django 1.4.3 to use multiple DBs, but for the life of me I can't make it to work. I read the documentation and posts on SO, and did the following:
1) Add a second DB ...
3
votes
3
answers
5k
views
Efficient way to pull data from second database?
We have a primary database where all of our app resides.
But there's a second database (updated from an external source), that I'd like to be able to connect to so I can pull data from it. I don't ...
2
votes
1
answer
7k
views
Laravel API connecting to multiple databases
I'm building a REST API with Laravel (Lumen). The idea is that this API provides the back-end for multiple food-ordering websites. They share the same back-end logic (models, controllers etc.). This ...
1
vote
1
answer
4k
views
fitting a function with multiple data sets using gnuplot
I would like to fit a function using many data sets. For example, I reproduce an experience many times, each time I obtain a pair of data column (x,y). I put all these column in a file named 'data.txt'...
1
vote
1
answer
5k
views
Syntax for Import Into from Different DBs - MS Access
I'm trying to do (basically) an automated row copy from one backend to another as the backend is being used but is not fully developed (some tables are done, others not; adding the completed data into ...
1
vote
4
answers
9k
views
How to connect to multiple databases in a single PHP page? [duplicate]
Possible Duplicate:
How do you connect to multiple MySQL databases on a single webpage?
If I want to connect to one db do some query, and then later do another query from another DB. How do I do ...
0
votes
2
answers
1k
views
performance of parameterized queries for different db's
A lot of people know that it is important to use parameterized queries to prevent sql injection attacks.
Parameterized queries are also much faster in sqlite and oracle when doing online transaction ...
0
votes
2
answers
11k
views
Switch dynamic database from other DB in Codeigniter
mi file config.php is:
$active_group = 'default';
$active_record = TRUE;
db master is unique DB
$db['master']['hostname'] = "localhost";
$db['master']['username'] = "root";
$db['master']['password']...
0
votes
2
answers
5k
views
How to use multiple databases with spring?
i need to create web-app (with spring+mysql) which should be a little like "MySQL Workbench online".
In my application, Users will be able to create their own databases. I did it as follows:
User ...
0
votes
1
answer
2k
views
SQL Run query across multiple Databases
I am looking to run a query over multiple databases. I've seen this function;
sp_MsForEachDb
Which is ok, but it runs through all the databases and I only want to use some of them. Is there a way ...
0
votes
1
answer
746
views
error No qualifying bean of type [javax.persistence.EntityManagerFactory] is defined: expected single matching bean but found 2
MySQL, postgresql
I want to put the same data in the same name table.
Both databases have the same table.
error
WARN 2017-07-04 14:53:03 o.s.c.s.GenericApplicationContext - Exception encountered ...
16
votes
1
answer
22k
views
laravel multiple databases with multiple migration tables
I am trying to set up a multiple database application in laravel 5. I have a database A and a second database B. In database A there are my main models. Now I tried to write a migration file that ...
11
votes
1
answer
10k
views
CoreData with multiple stores: configuration woes
I have an iOS project with a large, preloaded database and a small user database (both CoreData SQLite stores). Previous questions have suggested using configurations to control which Entities are ...
9
votes
2
answers
6k
views
Multiple Databases in play framework
I'm trying to establish a second database connection to another database on another server. We're using play framework 1.2.4 and I found the following documentation for 1.2.3.
http://www....
9
votes
2
answers
16k
views
EJB3 - using 2 persistence units within a transaction (Exception: Local transaction already has 1 non-XA Resource)
I am trying to use 2 persistence units within the same transaction in a Java EE application deployed on Glassfish.
The 2 persistence units are defined in persistence.xml, as follows:
<persistence-...
9
votes
3
answers
9k
views
Why is django_migrations table in all databases
I'm building a website under Django Framework, this website needs to have different SQL schemes, for now I succeeded creating all schemes and all stuff, but I don't understand why the table ...