I created a test program which creates 20 threads and then these threads will open many sql connection. Lets say you are executing this program from eclipse and now if you w
I believe that this depends on the database and the jdbc driver that you are using. I guess that in most cases the connections will be timed out and will be closed but it will not happen immediately. So, the better way is to close connection explicitly. Here are the usual techniques:
BTW I believe that in your case you do not need many connections to DB. Try to reuse one from all your 100 threads.