struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Verify" <>
Subject Re: Multiple databases in 1 Query
Date Mon, 09 Feb 2004 15:32:02 GMT
Thanks for the response.

Actually running queries from the sql prompt is  not the problem with me.

"What I want is to execute this query(using Multiple databases) through
some Action class. I am using MySQL"

Say :
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
DataSource dataSource = null;

dataSource = getDataSource(request);
conn = dataSource.getConnection();
stmt = conn.createStatement();

rs = stmt.executeQuery(sqlchkvalidity);

Here when I say

dataSource = getDataSource(request);
conn = dataSource.getConnection();

I always  get connection to a single Database, according to the Datasource
specified.  But the query has to use multiple databases.

So what do I do ?????
I am sorry If u r not able to understand my problem.

Thanks in advance for paying attention to my problem.


----- Original Message -----
From: "Verify" <>
To: "Struts Users Mailing List" <>
Sent: Friday, February 06, 2004 11:30 AM
Subject: Multiple databases in 1 Query

In my struts application I need two databases. I have used DBCP and defined
the datasources. I am able to use both the databases.
But I want to execute some query which will require tables from both the
Is it possible? If so how can I do it.

I kno that this is more of a database concept issue than a Struts issue, but
please help me.

Any comments and suggestions are welcome.
Thanks in advance for paying attention to my problem.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message