Activate query execution plan through JDBC driver
Posted in 2008
Topics: Connectivity: ODBC / JDBC / .NET, Java & JDBC Development
Hello, I want to activate the query execution plan to all the queries going through a JDBC driver. Just like doing "SET EXPLAIN ON" in all queries. Does anyone know if is it possible to activate this through a JDBC driver? Like some variable that one can pass to the JDBC connection URL in order to activate it? Thank you very much in advance Cheers
> From: alves.carlos@gmail.com> Subject: Activate query execution plan through JDBC driver> Date: Mon, 20 Oct 2008 05:08:24 -0700> To: informix-list@iiug.org> > Hello,> > I want to activate the query execution plan to all the queries going> through a JDBC driver. Just like doing "SET EXPLAIN ON" in all> queries.> Does anyone know if is it possible to activate this through a JDBC> driver? Like some variable that one can pass to the JDBC connection> URL in order to activate it?> > Thank you very much in advance> > Cheers> _______________________________________________ Unless I'm missing something, you would use the regular JDBC API to issue the command as if you were issuing any other SQL statement. I don't have the API up, but execute() method seems to come to mind. -G _________________________________________________________________ Store, manage and share up to 5GB with Windows Live SkyDrive. http://skydrive.live.com/welcome.aspx?provision=1?ocid=TXT_TAGLM_WL_skydrive_102008
Carlos Oliveira wrote:
> Hello,
>
> I want to activate the query execution plan to all the queries going
> through a JDBC driver. Just like doing "SET EXPLAIN ON" in all
> queries.
> Does anyone know if is it possible to activate this through a JDBC
> driver? Like some variable that one can pass to the JDBC connection
> URL in order to activate it?
>
> Thank you very much in advance
>
> Cheers
It's not related to the driver, but more with the engine version.
On v9.40.??? + you can activate the SET EXPLAIN with the onmode -Y command.
On v11 + you can use the SQL tracing facility.
On v11 + you can possibly use the sysdbopen procedure to activate it...
The onmode -Y may not be a good solution if your connection prepares the
statements upfront (you won't have time to see the session and give the command).
SQL tracing is probably the most flexible way.
If your connections come from an application server JDBC pool, you may have a
choice to configure some statements that are run just after the connection is
made. In WebSphere for example you could do this by configuring a custom helper
class. IIRC, WebLogic has some interface option to do it... I never saw JBoss....
Regards.
--
Fernando Nunes
Portugal
http://informix-technology.blogspot.com
My email works... but I don't check it frequently...