Hi Noel,

Unfortunately queries are written by clients and I cannot control them. My
intention is intercept the users' queries at the server (this is fully
controlled by me) and intercept the queries,  build the execution plan for
each one and abort some of them under some circumstances which I guess I
can manage properly if I was able to get the plan.

Thanks,
Pablo.

2015-06-11 17:08 GMT+02:00 Noel Grandin <[email protected]>:

> Just call executeQuery with EXPLAIN PLAN SELECT.......
> On Thu, 11 Jun 2015 at 16:09, Pablo Beltran <[email protected]> wrote:
>
>> Hi,
>>
>> i would like to  get the same text jist like the H2 Web Console when a
>> plan is explained (Pls, see the attached picture), but I did not get it yet
>> unfortunately.
>>
>>
>>
>> Connection conn  = ....
>>
>>
>> Statment st = con.createStatment("SELECT * FROM TABLE"),
>> st.executeQuery();
>>
>> ....
>>
>>
>> JdbcConnection jdbcConnection = (JdbcConnection) conn;
>> Session session = (Session) jdbcConnection.getSession();
>> Command current = session.getCurrentCommand(); //this method has been
>> added to the Session class.
>> Parser parser = new Parser(session);
>> Prepared prepared = parser.prepare(current.toString()); //SELECT * FROM
>> TABLE
>> Explain exp = new Explain(session);
>> exp.setCommand(prepared);
>>
>> and next??
>>
>> I've tried several things from here but without too much success.
>>
>> Any idea?
>>
>> Thanks in advance!
>> Pablo.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "H2 Database" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "H2 Database" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/h2-database/QQpyLqXHHtU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to