星期日, 9月 25, 2011

[Java] overcome 'too many connections'

記錄解決Too many connections方法。



實作Connection Pooling
http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html
如何避免連線數過多 refer to
http://stackoverflow.com/questions/2193603/how-to-overcome-java-sql-sqlexception-too-many-connections-exception

  • Yes you should close your Statements / ResultSets - These will typically reference the raw JDBCConnection rather than the PooledConnection proxy Connection returned by the DBCPPooledDataSource.
  • Consider using C3P0 rather than DBCP.
  • Consider using Spring to manage your JDBC operations and you will never have to worry about this kind of thing.

沒有留言:

張貼留言

留個話吧:)

其他你感興趣的文章

Related Posts with Thumbnails