-1

I run java program in debug mode using visualvm. I know my methods in the program are called from Main method but I have no idea why there are other threads. Is there a way I can reduce those threds?

visualvm result

enter image description here

goutthee
  • 329
  • 4
  • 14

1 Answers1

0

As suggested by those method names, they are threads started by MS SQL Server JDBC Connector for timeout checking(your sql request may went lost and without timeout checks, you could be blocked in a SQL request forever). They are started for your goodness and you should not try to stop/reduce them.

glee8e
  • 6,180
  • 4
  • 31
  • 51
  • thank u, I check the code. Yes there are methods I called from main method. The methods are called to get connection with database. Since there are such 4 methods, i found 4 extra thread. I used connection pool in main method then pass that connection as one of parameters for those 4 methods. Is there any better way than passing the connection through parameters of methods. – goutthee Jul 05 '16 at 03:52
  • I suggest you open a seperate question for that since that's really out of the scope of this one. I'm not very experienced in the field of JDBC. – glee8e Jul 05 '16 at 04:42