Skip to content
Advertisement

Java Melody does not show any sql data on xampp tomcat8

On Xampp Tomcat on Windows 11, I am trying to monitor java-web-app with java melody.
However, sql data is not detected by java melody.
Could you figure out what i am missing?

I have created a library project, not to do same settings on every app
Here is the projects code…
pom.xml:

JavaScript

TGS_ProfileServletUtils.java:

JavaScript

TS_ProfileMelodyUtils.java:

JavaScript

a helper class

JavaScript

On another api, this is how i create a pool
(I skipped some class files, unrelated to the question)

JavaScript

WAY1:

JavaScript

WAY1 RESULT: enter image description here

WAY2:

JavaScript

WAY2 RESULT: (same, nothing changed) enter image description here

WAY3:

JavaScript

WAY3 RESULT: (same, nothing changed) enter image description here

Advertisement

Answer

I think i found the problem.

  • One should create connection from proxy_datasource not pool_datasource

    var pool_con = pool_ds.getConnection(); //WRONG
    var pool_con = proxy_ds.getConnection(); //RIGHT

  • And also, on creating statements,
    one should use proxy connections (proxy_con) to create statements, not main connection (pool_con)!

    I used way 3. And the results were singleton. I think java melody detects that it has a datasource already; and does not log twice.

full code: at github-profile
full code: at github-sql-conn

Advertisement