how to get complete sql before execute query??

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to get complete sql before execute query??

ldy ldy
I want to know how to get complete sql before execute find or other methods,
it is better to get complete sql and  take it as cache key

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/ba929b4f-79a5-49bb-906c-17867699bb96n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: how to get complete sql before execute query??

Guy Rouillier-2
Found an example here:


Briefly, you want to call getBoundSql() on the statement. In that page, ignore the suggestion to use ${param} instead of #{param}.  The former does text substitution instead of SQL parameters, which is not secure - SQL injection - and not advisable.

--
Guy Rouillier

On 12/29/2020 3:49:25 AM, "ldy ldy" <[hidden email]> wrote:

I want to know how to get complete sql before execute find or other methods,
it is better to get complete sql and  take it as cache key

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/ba929b4f-79a5-49bb-906c-17867699bb96n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/ema1d131eb-d044-46d0-a3b6-33ddf61f41fa%40asus.