I have a bunch of java programs that are run every few minutes. These programs are started by a script every few minutes and terminates in less than a minute. Most of them are single threaded and to access MySQL DB I use:
DriverManager.getConnection()
They just need to connect once, and execute a query. Now I'm adding a new program to this group which is multi threaded and all the threads need to access DB concurrently. I'm thinking of using a DB connection pool (c3p0) for this.
My question is, as all these programs share a common DAO for accessing DB, is there an overhead of using a DB connection pool for the single threaded programs even though they just need one connection? I'm planning to set initialPool size to 1, min pool size to 1 and max pool size to 10.