Skip navigation links

MySQL Forums :: Connector/JDBC and Java :: Can not issue data manipulation statements with executeQuery().


Advanced Search

Can not issue data manipulation statements with executeQuery().
Posted by: derrick cui ()
Date: August 11, 2009 01:24PM

I can run sql statement on command line successfully, but once I put these sql statements in Hibernate Mapping file, always gave me this error message.

Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
... 55 more
Caused by: java.sql.SQLException: Can not issue data manipulation statements with executeQuery().

the following is my sql statement:
CREATE TEMPORARY TABLE access_group_change_list
select distinct modification_timestamp, modified_by
from LOYALTY.access_group_history
where client_id = :clientId
and ( db_action in ('I', 'D')
or modification_timestamp in
(select max(modification_timestamp)
from LOYALTY.access_group_history
where client_id = :clientId)
)
;

CREATE TEMPORARY TABLE access_group_list
select access_group_id
from LOYALTY.access_group
where client_id = :clientId
;

CREATE TEMPORARY TABLE access_group_object_change_list
select modification_timestamp,
modified_by
from LOYALTY.v_organisation_object_group_history
where top_id = :clientId
order by modification_timestamp desc
limit 1
;

create temporary table agi_1 select access_group_id from access_group_list;
create temporary table agi_2 select access_group_id from access_group_list;
create temporary table agi_3 select access_group_id from access_group_list;

CREATE TEMPORARY TABLE other_latest_change_list
select modification_timestamp, modified_by
from access_group_object_change_list
union
select distinct modification_timestamp, modified_by
from LOYALTY.access_group_client_rhistory
where modification_timestamp in (
select max(modification_timestamp)
from LOYALTY.access_group_client_rhistory
where access_group_id in (select access_group_id from agi_1)
)
union
select distinct modification_timestamp, modified_by
from LOYALTY.access_group_members_rhistory
where modification_timestamp in (
select max(modification_timestamp)
from LOYALTY.access_group_members_rhistory
where access_group_id in (select access_group_id from agi_2)
)
union
select distinct modification_timestamp, modified_by
from LOYALTY.access_group_visibility_rhistory
where modification_timestamp in (
select max(modification_timestamp)
from LOYALTY.access_group_visibility_rhistory
where viewer_access_group_id in (select access_group_id from agi_3)
)
;

CREATE TEMPORARY TABLE all_change_list
(select distinct modification_timestamp, modified_by
from other_latest_change_list
order by modification_timestamp
limit 1)
union
(select modification_timestamp, modified_by
from access_group_change_list)
;

select distinct modification_timestamp, modified_by
from all_change_list
order by modification_timestamp desc

Options: ReplyQuote


Subject Written By Posted
Can not issue data manipulation statements with executeQuery(). derrick cui 08/11/2009 01:24PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.