Results 1 to 1 of 1
- 07-11-2007, 01:22 AM #1
Member
- Join Date
- Jul 2007
- Posts
- 1
- Rep Power
- 0
how do i run EXECUTE DBMS_MVIEW.REFRESH script from within java
Hi there,
I have some materialized views in an oracle database. Due to the complexity of the query used to create the views I can not get the views to refresh on commit. I add information to the tables that the view is created from every half an hour using a quartz job. To refresh the view I wanted to run the following script from within java after the quartz job has run
EXECUTE DBMS_MVIEW.REFRESH('AWS_VIEW_LAST48_CAPEBG')
I tried to run it as I normally would run sql using the following code where REFRESH_ALL_VIEWS is a string containing the above script
Connection con = pool.getConnection();
PreparedStatement refresh = null;
try {
refresh = con.prepareStatement(REFRESH_ALL_VIEWS);
refresh.executeQuery();
} catch (java.sql.SQLException e) {
throw new RuntimeException(e);
} finally……..
However I get the following error :
java.sql.SQLException: ORA-00900: invalid SQL statement
I understand that it is not a valid sql statement and this is why I am getting the error.
Could anyone please tell me how I can run the script using java
Thanks,
Alex
Similar Threads
-
calling a perl script in Java(using a OK Button)
By Yaya B in forum NetBeansReplies: 1Last Post: 01-07-2011, 07:20 AM -
logout using java script
By pankajagar2001 in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 01-03-2008, 06:37 AM -
How to instantiate Class, into jsp, java script
By silvia in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 08-07-2007, 05:45 AM -
The lasted java script
By silvia in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 08-07-2007, 05:44 AM -
Execute a new program in java
By mathias in forum Advanced JavaReplies: 1Last Post: 07-31-2007, 05:42 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks