I have to develop Java scheduler task (Job) which has to run each and every 5 minutes periodically. I have two ideas two keep the connection pool and i don't know what should be the best way.
Method 1 : Crates connection pool each and every 5 minutes Query Closes the connection
Method 2 : Crates connection pool at initiation of the Java Job Query each and every 5 minutes Keeps the connection alive without closing
I just wanted to know what should be the ideal way to handle this scenario