aspose file tools*
The moose likes JDBC and the fly likes set showplan_all on java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "set showplan_all on java" Watch "set showplan_all on java" New topic
Author

set showplan_all on java

ram prabhu
Greenhorn

Joined: Aug 18, 2005
Posts: 8
Hi... can u just tell me how to call set showplan_all(sql command) in java.i have to find the time taken to execute the query before executing it.

the command i used is SET SHOWPLAN_ALL ON..i am able to get the time before that.but i dont know how to call these commands in java.i tried with the resultset but it seems to be not working..

i just tried this...
ResultSet oldrs=state.executeQuery("SET SHOWPLAN_ALL ON");
ResultSet rs=state.executeQuery("SELECT * FROM DEPT");
ResultSet newrs=state.executeQuery("SET SHOWPLAN_ALL OFF);

but i am getting the error No Resultset SET was found..

can anyone just help me to get out of this trouble.

thanks

regards
ramprabhu
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
"set blah" statements aren't queries. Take a look at the Sun Javadoc for statements. executeQuery() isn't your only option. You only use it when the statement is going to return results.


Reid - SCJP2 (April 2002)
 
Consider Paul's rocket mass heater.
 
subject: set showplan_all on java