I'm trying to set up javamelody to show statistics the queries I cast against mssql. The project environment is made up of the following technologies:
- Java jdk 1.8
- Tomcat 9.0.0.M15
- Javamelody 1.70.0
- Hibernate 5.2.12.Final
- Driver com.microsoft.sqlserver.jdbc.SQLServerDriver
The configuration file web.xml contains the following configuration for javamelody:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
...
<!-- Configuración de javamelody -->
<filter>
<filter-name>monitoring</filter-name>
<filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>monitoring</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>net.bull.javamelody.SessionListener</listener-class>
</listener>
<distributable/>
...
</web-app>
On the other hand, the hibernate configuration file has the following database access configuration:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="hibernate.connection.url">
jdbc:sqlserver://localhost:1433;databaseName=****;instanceName=SQLEXPRESS;
</property>
<property name="hibernate.connection.username">****</property>
<property name="hibernate.connection.password">****</property>
...
</session-factory>
</hibernate-configuration>
This same configuration works for mysql (obviously changing the connection parameters), however with Microsoft SQL Server I have not been able to visualize the statistics of the queries.