OFBiz: Set up SQL statement output on the console

Source: Internet
Author: User

OFBiz: Set SQL statement output on the console

To study the association between entity and view-entity in OFBiz, we also want to see how to output SQL statements. By default, the output SQL statements are subject to time restrictions. How can we cancel this operation?

 

1. Make sure print. Timing = true in debug. properties.

 

2. Open genericdao. Java, which contains approximately 798 rows (even 12.04 rows)

If (Debug. timingon ()){
Long queryendtime = system. currenttimemillis ();
Long querytotaltime = queryendtime-querystarttime;
When (querytotaltime> 150 ){
Debug. logtiming ("ran query in" + querytotaltime + "milli-seconds:" + SQL, module );
}
}

Annotate it, as shown in

// If (querytotaltime> 150 ){
Debug. logtiming ("ran query in" + querytotaltime + "milli-seconds:" + SQL, module );
//}

 

3. recompile and run-install

 

You can enter SQL statements in the console.

 

If any of the above is incorrect, please add

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.