G
goli
Hi,
I have this query:
(code summary)
********
....
bsrQuery =
"SELECT * FROM devices INNER JOIN bsr ON
devices.DeviceOrigIndex = bsr.BsrIndex WHERE DeviceType="
+ WipmngConstants.BSR;
sprQuery =
"SELECT * FROM devices INNER JOIN spr ON
devices.DeviceOrigIndex = spr.SprIndex WHERE DeviceType="
+ WipmngConstants.SPR;
bsduQuery =
"SELECT MngIP, GetCommunity, SetCommunity, DeviceType FROM
devices INNER JOIN bsdu ON devices.DeviceOrigIndex = bsdu.BsduIndex
WHERE DeviceType="
+ WipmngConstants.BSDU;
q1 = bsrQuery + " UNION ALL " + sprQuery/* + " UNION " +
bsduQuery*/;
//q1 = sprQuery + " UNION ALL " + bsrQuery/* + " UNION " +
bsduQuery*/;
statementDevTbl =
wipllDb.connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
//System.out.println(q1);
resultSet = statementDevTbl.executeQuery(q1);
.....
*********
When I run q1 in MS-Access it gives me the correct answer. Eg. the
actual union of the two queries.
BUT !! when I do the code above, it doesn't return the union, but only
results of one table.
My driver supports UNION (getMetaData().supportsUnion() is true).
Does anyone knows something about it ?
Tahnks
I have this query:
(code summary)
********
....
bsrQuery =
"SELECT * FROM devices INNER JOIN bsr ON
devices.DeviceOrigIndex = bsr.BsrIndex WHERE DeviceType="
+ WipmngConstants.BSR;
sprQuery =
"SELECT * FROM devices INNER JOIN spr ON
devices.DeviceOrigIndex = spr.SprIndex WHERE DeviceType="
+ WipmngConstants.SPR;
bsduQuery =
"SELECT MngIP, GetCommunity, SetCommunity, DeviceType FROM
devices INNER JOIN bsdu ON devices.DeviceOrigIndex = bsdu.BsduIndex
WHERE DeviceType="
+ WipmngConstants.BSDU;
q1 = bsrQuery + " UNION ALL " + sprQuery/* + " UNION " +
bsduQuery*/;
//q1 = sprQuery + " UNION ALL " + bsrQuery/* + " UNION " +
bsduQuery*/;
statementDevTbl =
wipllDb.connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
//System.out.println(q1);
resultSet = statementDevTbl.executeQuery(q1);
.....
*********
When I run q1 in MS-Access it gives me the correct answer. Eg. the
actual union of the two queries.
BUT !! when I do the code above, it doesn't return the union, but only
results of one table.
My driver supports UNION (getMetaData().supportsUnion() is true).
Does anyone knows something about it ?
Tahnks