No results returned with JDBC query using UNION and DUAL
From: Andy (andy.cole_at_fdgroup.com)
Date: 01/26/04
- Next message: Robert Klemme: "Re: Newbie: Simple Update Query JDBC problem"
- Previous message: Christophe Vanfleteren: "Re: Servlet can't communicate with 'Database made using XML' !"
- Next in thread: Joe Weinstein: "Re: No results returned with JDBC query using UNION and DUAL"
- Reply: Joe Weinstein: "Re: No results returned with JDBC query using UNION and DUAL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 26 Jan 2004 03:17:01 -0800
I am trying to run the following sql using
Statement s = connection.createStatement();
ResultSet result = s.executeQuery(command);
while (result.next()) { ... }
The sql returns the privileges that the user does *not* have, given a
list of privs that are required. It returns the correct results using
Sql*plus but no results using jdbc (i.e. result.next()=false). No
exceptions are thrown, unless I ignore the fact that resultset
returned false and try to do result.getString(1) anyway. Then I get
java.sql.SQLException: Exhausted Resultset
I wondered if it was due to the unusual nature of the query, i.e.
using selects from dual to create a 'fake' table.
select tempPrivs.priv from (
select 'ALTER USER' priv from dual
union select 'CREATE PROCEDURE' priv from dual
union select 'CREATE SYNONYM' priv from dual
union select 'CREATE TABLE' priv from dual ) tempPrivs
where not exists (select null from user_sys_privs
where privilege = tempPrivs.priv);
I am using Windows XP, Oracle 8.1.7.4 database, Oracle JDBC drivers
9.2.0.4 and J2SE 1.4.1.
Anyone have any ideas?
Andy Cole.
- Next message: Robert Klemme: "Re: Newbie: Simple Update Query JDBC problem"
- Previous message: Christophe Vanfleteren: "Re: Servlet can't communicate with 'Database made using XML' !"
- Next in thread: Joe Weinstein: "Re: No results returned with JDBC query using UNION and DUAL"
- Reply: Joe Weinstein: "Re: No results returned with JDBC query using UNION and DUAL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|