I use jOOQ to query/insert/update data from/into a table.
Is there a way to see the SQL statements that JOOQ executes?
The DISPLAY command must be placed immediately after the query statement on which you want it to take effect. For example: SELECT pno, pname FROM part WHERE color='BLUE'; DISPLAY; When the system encounters this DISPLAY command, it displays the Result window containing the part number and name for all blue parts.
In order to execute an SQL statement, you must first prepare the SQL statement. During preparation, the database will usually precompile the SQL statement and creates an access plan for the statement. The access plan is kept as long as the statement exists. You can then execute the statement as many times as you want.
Data Manipulation Language (DML) Statements. Transaction Control Statements. Session Control Statements.
Look for your log configuration file (or create one) and set the log level of the class org.jooq.tools.LoggerListener
as debug
or trace
, e.g. into log4j.properties
.
In spring you can set the log level DEBUG into your application.properties this way
logging.level.org.jooq.tools.LoggerListener=DEBUG
For the following query
create.select(BOOK.ID, BOOK.TITLE).from(BOOK).orderBy(BOOK.ID).limit(1, 2).fetch();
you should get a log like
Executing query : select "BOOK"."ID", "BOOK"."TITLE" from "BOOK" order by "BOOK"."ID" asc limit ? offset ?
-> with bind values : select "BOOK"."ID", "BOOK"."TITLE" from "BOOK" order by "BOOK"."ID" asc limit 2 offset 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With