permaculture playing cards
The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "set showplan_all on java" Watch "set showplan_all on java" New topic

set showplan_all on java

ram prabhu

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.


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)
I agree. Here's the link:
subject: set showplan_all on java
It's not a secret anymore!