0

enter image description here

I am using JVisualVm's jdbc profiler to monitor my local java program.

It would capture something like this:

select * from reservation v where v.name like '%'%'

If you try to run this in pgadmin, it would throw error:

enter image description here

For PgAdmin to run it, we have to escape the single quote in the string:

select * from reservation where name like '%''%'

Basically we need to change ' to '' so that the string the sql does not get cut off into 2 pieces.

My question is: is visual vm's jdbc profiler able to capture the final sql statement that gets executed by the DB?

Cui Pengfei 崔鹏飞
  • 8,017
  • 6
  • 46
  • 87
  • 1
    Unlikely, because there is nothing in the JDBC API that allows you to capture what the driver implementation sends to the server. – Mark Rotteveel Jul 17 '23 at 12:28

0 Answers0