JavaMelody monitoring SQL

Source: Internet
Author: User

JavaMelody monitoring SQL
Searching for a lot of information on the Internet, only two posts in the open-source community are helpful, but there are still many problems with monitoring SQL. Many netizens have encountered the same problems as me, when the monitoring page is opened, the data cannot be monitored. The SQL column is 0 or NaN in any case. This problem is because the data source is not correctly configured. Here we will introduce two configuration methods. First, directly configure the data source and add an additional jdbc driver. According to the document in UserGuide, you can use Jndi to configure the data source. For example, if Hibernate is used. cfg. <property name = "hibernate. connection. driver_class "> net. bull. javamelody. jdbcDriver </property> <property name = "hibernate. connection. driver "> com. mysql. jdbc. driver </property> <property name = "hibernate. connection. url "> jdbc: mysql: // localhost: 3306/myschema </property> <property name =" hibernate. connection. Username "> myuser </property> <property name =" hibernate. connection. password "> mypassword </property> copy the code to pay attention to this location, which may be a common hibernate. cfg. the xml parameter is not like the configuration above. It doesn't matter. You only need to ensure that the original connection. driver is a real driver. Add the connection. driver_class parameter above to be the jdbc driver of javamelody. That is, refer to the following oracle hibernate data source file copy Code <? Xml version = "1.0" encoding = "GBK"?> <! -- Specify the DTD information of the Hibernate configuration file --> <! DOCTYPE hibernate-configuration PUBLIC "-// Hibernate/Hibernate Configuration DTD 3.0 // EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <! -- Hibernate-configuration is the root element connecting to the configuration file -->

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.