title: MySQL JDBC connection pool maximum size
body: <p>I'm building a socket server with Java. Each new socket connection launches a new thread which will need a connection to a MySQL server.</p>
  
  <p>Currently I have a new connection for every thread but would like to change to a connection pool so that I can more effectively recycle connections.</p>
  
  <p>However, the default size of this pool seems to be of 5 connections. I'm currently handling more than 100 clients and 5 connections won't be enough. All of the documentation I've found mention the different servers (Tomcat, JBoss, GlassFish, etc) and how to place the value in their XML configuration files.</p>
  
  <p>Since I'm not using any of these, I can't find how to set the <code>max pool size</code> value. I would also like to avoid third party libraries for this project (such as Apache Commons).</p>
  
  <p>An exception to that would be the MySQL connector for Java (found here: <a href="http://dev.mysql.com/usingmysql/java/" rel="nofollow">http://dev.mysql.com/usingmysql/java/</a>)</p>
  
  <p>The only possible reference I've found is <code>env.put(JNDIPooledSource.MAX_POOL_SIZE, 500);</code> but I don't believe that's correct.</p>
  
  <p>Thanks for your help.</p>