• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

set showplan_all on java

 
ram prabhu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic