how to get complete sql before execute query??

44 views
Skip to first unread message

ldy ldy

unread,
Dec 29, 2020, 3:49:25 AM12/29/20
to mybatis-user
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

Guy Rouillier

unread,
Dec 30, 2020, 3:06:15 AM12/30/20
to MyBatis User
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" <qq1098...@gmail.com> 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 mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/ba929b4f-79a5-49bb-906c-17867699bb96n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages