{"id":3980,"date":"2018-06-11T22:27:55","date_gmt":"2018-06-11T14:27:55","guid":{"rendered":"https:\/\/ixyzero.com\/blog\/?p=3980"},"modified":"2018-06-11T22:27:55","modified_gmt":"2018-06-11T14:27:55","slug":"java%e4%b8%ad%e4%bd%bf%e7%94%a8c3p0%e5%bb%ba%e7%ab%8bmysql%e6%95%b0%e6%8d%ae%e5%ba%93%e8%bf%9e%e6%8e%a5%e6%b1%a0","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/3980.html","title":{"rendered":"Java\u4e2d\u4f7f\u7528c3p0\u5efa\u7acbMySQL\u6570\u636e\u5e93\u8fde\u63a5\u6c60"},"content":{"rendered":"<p>=Start=<\/p>\n<h4 id=\"id-\u6a21\u677f-\u7f18\u7531\uff1a\">\u7f18\u7531\uff1a<\/h4>\n<p>\u5728\u5b66\u4e60Java\u7684\u8fc7\u7a0b\u4e2d\u4e0d\u65ad\u7528\u6587\u7ae0\u8fdb\u884c\u6574\u7406\u603b\u7ed3\uff08\u5e38\u7528\u529f\u80fd\u7684Java\u5b9e\u73b0\uff09\uff0c\u4e89\u53d6\u65e9\u65e5\u80fd\u8f83\u4e3a\u719f\u7ec3\u7684\u4f7f\u7528Java\u8fdb\u884c\u5f00\u53d1\u3002<\/p>\n<p>\u672c\u6765\u7528c3p0\u5efa\u7acb\u6570\u636e\u5e93\u8fde\u63a5\u6c60\u8fd9\u90e8\u5206\u5185\u5bb9\u53ea\u60f3\u7528\u4e00\u7bc7\u6587\u7ae0\u7684\u4e00\u90e8\u5206\u6765\u8fdb\u884c\u4ee3\u7801\u6837\u4f8b\u8bf4\u660e\u7684\uff0c\u4f46\u662f\u6ca1\u60f3\u5230\u5728\u7f51\u4e0a\u641c\u5230\u7684\u4e00\u4e9b\u4ecb\u7ecd\u6027\u6587\u7ae0\u6216\u591a\u6216\u5c11\u90fd\u6709\u4e9b\u95ee\u9898\uff0c\u5bf9\u4e8e\u6211\u8fd9\u6837\u7684\u521d\u5b66\u8005\u592a\u4e0d\u53cb\u597d\uff0c\u4e00\u4e9b\u672c\u6765\u5f88\u7b80\u5355\u7684\u95ee\u9898\u5c31\u56e0\u4e3a\u4ed6\u4eec\u6587\u7ae0\u4e2d\u7684\u4e00\u53e5\u8bdd\u8ba9\u6211\u8d70\u4e86\u4e0d\u5c11\u5f2f\u8def\uff0c\u6240\u4ee5\u611f\u89c9\u6709\u5fc5\u8981\u5355\u72ec\u8bb0\u5f55\u4e00\u4e0b\u8fd9\u4e2a\u8fc7\u7a0b\uff0c\u65b9\u4fbf\u81ea\u5df1\u53c2\u8003\u3001\u67e5\u9605\u3002<\/p>\n<h4 id=\"id-\u6a21\u677f-\u6b63\u6587\uff1a\">\u6b63\u6587\uff1a<\/h4>\n<h5 id=\"id-\u6a21\u677f-\u53c2\u8003\u89e3\u7b54\uff1a\">\u53c2\u8003\u89e3\u7b54\uff1a<\/h5>\n<h6><strong>1\u3001c3p0\u7684\u57fa\u672c\u6982\u5ff5<\/strong><\/h6>\n<p>c3p0\u662f\u4e00\u4e2a\u5f00\u6e90\u7684JDBC\u8fde\u63a5\u6c60\uff0c\u5b83\u5b9e\u73b0\u4e86\u6570\u636e\u6e90\u548cJNDI\u7ed1\u5b9a\uff0c\u652f\u6301JDBC3\u89c4\u8303\u548cJDBC2\u7684\u6807\u51c6\u6269\u5c55\u3002<\/p>\n<h6><strong>2\u3001c3p0\u7684\u51e0\u79cd\u914d\u7f6e\u65b9\u5f0f<\/strong><\/h6>\n<p>c3p0\u7684\u914d\u7f6e\u65b9\u5f0f\u5206\u4e3a\u4e09\u79cd\uff0c\u5206\u522b\u662f\uff1a<\/p>\n<ol>\n<li>\u4f7f\u7528c3p0-config.xml\u6587\u4ef6\uff08<strong>\u6587\u4ef6\u540d\u79f0\u56fa\u5b9a<\/strong>\uff09\uff1b<\/li>\n<li>\u4f7f\u7528c3p0.properties\u6587\u4ef6\uff08<strong>\u6587\u4ef6\u540d\u79f0\u56fa\u5b9a<\/strong>\uff09\uff1b<\/li>\n<li>\u7528setters\u4e00\u4e2a\u4e2a\u5730\u8bbe\u7f6e\u5404\u4e2a\u914d\u7f6e\u9879\u3002<\/li>\n<\/ol>\n<p><span style=\"color: #ff0000;\"><strong>\u7279\u522b\u8bf4\u660e\uff1a\u5bf9\u4e8e\u7528IDEA\u5efa\u7acb\u7684Maven\u9879\u76ee\u6765\u8bf4\uff0c\u4e0a\u9762\u7684c3p0-config.xml\u548cc3p0.properties\u6587\u4ef6\uff0c\u8981\u653e\u5728\u9879\u76ee\u7684\u300cresources\u300d\u76ee\u5f55\u4e0b<\/strong><\/span>\uff0c\u800c\u4e0d\u662f\u4e00\u4e9b\u6587\u7ae0\u91cc\u8bf4\u7684\u300csrc\u300d\u76ee\u5f55\u4e0b\uff0c\u5426\u5219\u4f1a\u51fa\u73b0\uff1a<\/p>\n<blockquote><p>java.sql.SQLException: Connections could not be acquired from the underlying database!<\/p>\n<p>Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.<\/p><\/blockquote>\n<p>\u7684\u9519\u8bef\u3002<\/p>\n<h6><strong>3\u3001\u4e0d\u540c\u65b9\u5f0f\u7684\u914d\u7f6e\u6837\u4f8b<\/strong><\/h6>\n<p><span style=\"color: #ff0000;\"><strong>\u2460c3p0-config.xml\u6587\u4ef6\u7684\u914d\u7f6e\u65b9\u5f0f<\/strong><\/span><\/p>\n<pre class=\"lang:default decode:true \">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;c3p0-config&gt;\r\n    &lt;!-- \u9ed8\u8ba4\u914d\u7f6e\uff0c\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u5219\u4f7f\u7528\u8fd9\u4e2a\u914d\u7f6e --&gt;\r\n    &lt;default-config&gt;\r\n        &lt;property name=\"jdbcUrl\"&gt;jdbc:mysql:\/\/localhost:3306\/test&lt;\/property&gt;\r\n        &lt;property name=\"driverClass\"&gt;com.mysql.jdbc.Driver&lt;\/property&gt;\r\n        &lt;property name=\"user\"&gt;root&lt;\/property&gt;\r\n        &lt;property name=\"password\"&gt;123456&lt;\/property&gt;\r\n\r\n        &lt;property name=\"checkoutTimeout\"&gt;3000&lt;\/property&gt;\r\n        &lt;property name=\"idleConnectionTestPeriod\"&gt;30&lt;\/property&gt;\r\n        &lt;property name=\"initialPoolSize\"&gt;10&lt;\/property&gt;\r\n        &lt;property name=\"maxIdleTime\"&gt;30&lt;\/property&gt;\r\n        &lt;property name=\"maxPoolSize\"&gt;100&lt;\/property&gt;\r\n        &lt;property name=\"minPoolSize\"&gt;10&lt;\/property&gt;\r\n        &lt;property name=\"maxStatements\"&gt;200&lt;\/property&gt;\r\n    &lt;\/default-config&gt;\r\n\r\n    &lt;!-- \u547d\u540d\u7684\u914d\u7f6e --&gt;\r\n    &lt;named-config name=\"mysqlConnection\"&gt;\r\n        &lt;property name=\"jdbcUrl\"&gt;jdbc:mysql:\/\/localhost:3306\/test&lt;\/property&gt;\r\n        &lt;property name=\"driverClass\"&gt;com.mysql.jdbc.Driver&lt;\/property&gt;\r\n        &lt;property name=\"user\"&gt;root&lt;\/property&gt;\r\n        &lt;property name=\"password\"&gt;123456&lt;\/property&gt;\r\n\r\n        &lt;property name=\"initialPoolSize\"&gt;25&lt;\/property&gt;\r\n        &lt;property name=\"maxPoolSize\"&gt;50&lt;\/property&gt;\r\n        &lt;property name=\"minPoolSize\"&gt;5&lt;\/property&gt;\r\n        &lt;property name=\"acquireIncrement\"&gt;5&lt;\/property&gt;\r\n    &lt;\/named-config&gt;\r\n&lt;\/c3p0-config&gt;<\/pre>\n<p>\u5bf9\u5e94\u7684Java\u6d4b\u8bd5\u4ee3\u7801\u4e3a\uff1a<\/p>\n<pre class=\"lang:default decode:true\">package com.ixyzero.learn.db;\r\n\r\nimport com.mchange.v2.c3p0.ComboPooledDataSource;\r\n\r\nimport java.sql.Connection;\r\nimport java.sql.PreparedStatement;\r\nimport java.sql.ResultSet;\r\n\r\n\/**\r\n * Created by ixyzero.com on 2018\/6\/11.\r\n *\/\r\npublic class TestConnXml {\r\n    private static ComboPooledDataSource dataSource = new ComboPooledDataSource();\r\n\r\n    public static void main(String[] args) {\r\n        try{\r\n            Connection connection = dataSource.getConnection();\r\n            System.out.println(\"\u8fde\u63a5\u6570\u636e\u5e93\u6210\u529f\uff01\");\r\n\r\n            \/\/ \u6267\u884c\u67e5\u8be2\u8bed\u53e5\r\n            String sql = \"select * from websites limit 3\";\r\n            PreparedStatement ps = connection.prepareStatement(sql);\r\n            ResultSet rs = ps.executeQuery();\r\n            while (rs.next()) {\r\n                System.out.println(rs.getString(1));\r\n            }\r\n\r\n            connection.close();\r\n            System.out.println(\"\u6570\u636e\u5e93\u8fde\u63a5\u5df2\u5173\u95ed\uff01\");\r\n        }catch(Exception e) {\r\n            e.printStackTrace();\r\n            System.out.println(\"\u8fde\u63a5\u6570\u636e\u5e93\u5931\u8d25\uff01\");\r\n        }\r\n\r\n    }\r\n}<\/pre>\n<p><span style=\"color: #ff0000;\"><strong>\u2461c3p0.properties\u6587\u4ef6\u7684\u914d\u7f6e\u65b9\u5f0f<\/strong><\/span><\/p>\n<pre class=\"lang:default decode:true \">c3p0.driverClass=com.mysql.jdbc.Driver\r\nc3p0.jdbcUrl=jdbc:mysql:\/\/localhost:3306\/test\r\nc3p0.user=root\r\nc3p0.password=123456<\/pre>\n<p><span style=\"color: #ff0000;\"><strong>\u6ce8\u610f\uff1a\u91c7\u7528c3p0.properties\u6587\u4ef6\u8fdb\u884c\u914d\u7f6e\u7684\uff0c\u90fd\u8981\u52a0\u4e0a\u524d\u7f00\u300cc3p0.\u300d\uff0c\u5426\u5219\u4e5f\u4f1a\u51fa\u73b0\u8fde\u4e0d\u4e0a\u7684\u9519\u8bef\uff01<\/strong><\/span><\/p>\n<p>\u6d4b\u8bd5\u4ee3\u7801\u548c\u4e0a\u9762\u7684\u76f8\u540c\u3002<\/p>\n<p><strong>\u2462\u7528setter\u4e00\u4e2a\u4e2a\u7684\u8bbe\u7f6e\u76f8\u5173\u914d\u7f6e\u9879<\/strong><\/p>\n<p>\u8fd9\u4e2a\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u6570\u636e\u5e93\u7528\u6237\u540d\u3001\u5bc6\u7801\u3001\u8fde\u63a5\u7b49\u4fe1\u606f\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5199\u5728\u4ee3\u7801\u4e2d\uff1a<\/p>\n<pre class=\"lang:default decode:true \">package com.ixyzero.learn.db;\r\n\r\nimport com.mchange.v2.c3p0.ComboPooledDataSource;\r\n\r\nimport java.beans.PropertyVetoException;\r\nimport java.sql.Connection;\r\nimport java.sql.PreparedStatement;\r\nimport java.sql.ResultSet;\r\n\r\n\/**\r\n * Created by ixyzero.com on 2018\/6\/11.\r\n *\/\r\npublic class TestConn {\r\n    private static ComboPooledDataSource dataSource = new ComboPooledDataSource();\r\n\r\n    public static void main(String[] args) {\r\n        dataSource.setUser(\"root\");\r\n        dataSource.setPassword(\"123456\");\r\n        dataSource.setJdbcUrl(\"jdbc:mysql:\/\/localhost:3306\/test\");\r\n        try {\r\n            dataSource.setDriverClass(\"com.mysql.jdbc.Driver\");\r\n        } catch (PropertyVetoException e) {\r\n            e.printStackTrace();\r\n            System.out.println(\"setDriverClass \u5931\u8d25\uff01\");\r\n            return;\r\n        }\r\n        dataSource.setInitialPoolSize(5);\r\n        dataSource.setMinPoolSize(1);\r\n        dataSource.setMaxPoolSize(10);\r\n        dataSource.setMaxStatements(50);\r\n        dataSource.setMaxIdleTime(60);\r\n        System.out.println(dataSource);\r\n\r\n        try{\r\n            Connection connection = dataSource.getConnection();\r\n            System.out.println(\"\u8fde\u63a5\u6570\u636e\u5e93\u6210\u529f\uff01\");\r\n\r\n            \/\/ \u6267\u884c\u67e5\u8be2\u8bed\u53e5\r\n            String sql = \"select * from websites\";\r\n            PreparedStatement ps = connection.prepareStatement(sql);\r\n            ResultSet rs = ps.executeQuery();\r\n            while (rs.next()) {\r\n                System.out.println(rs.getString(1));\r\n            }\r\n\r\n            connection.close();\r\n            System.out.println(\"\u6570\u636e\u5e93\u8fde\u63a5\u5df2\u5173\u95ed\uff01\");\r\n        }catch(Exception e){\r\n            e.printStackTrace();\r\n            System.out.println(\"\u8fde\u63a5\u6570\u636e\u5e93\u5931\u8d25\uff01\");\r\n        }\r\n    }\r\n\r\n}<\/pre>\n<p>&amp;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u4e0b\u9762\u7528\u5230\u7684\u914d\u7f6e\u6587\u4ef6\u4e5f\u8981\u653e\u5728\u9879\u76ee\u7684\u300cresources\u300d\u76ee\u5f55\u4e0b\uff01<\/strong><\/span><\/p>\n<pre class=\"lang:default decode:true\">public class TestConnProperties {\r\n    private static Properties prop = new Properties();\r\n    private static InputStream in = TestConnProperties.class.getClassLoader().getResourceAsStream(\"db.properties\");\r\n    private static ComboPooledDataSource dataSource = new ComboPooledDataSource();\r\n\r\n    public static void main(String[] args) {\r\n        try {\r\n            prop.load(in);\r\n        } catch (IOException e) {\r\n            e.printStackTrace();\r\n        }\r\n\r\n        dataSource.setUser(prop.getProperty(\"username\"));\r\n        dataSource.setPassword(prop.getProperty(\"password\"));\r\n        dataSource.setJdbcUrl(prop.getProperty(\"url\"));\r\n        try {\r\n            dataSource.setDriverClass(prop.getProperty(\"jdbcdriver\"));\r\n        } catch (PropertyVetoException e) {\r\n            e.printStackTrace();\r\n        }\r\n\r\n        \/\/...\r\n    }\r\n}<\/pre>\n<h6><span style=\"color: #ff0000;\"><strong>4\u3001\u548c\u4e0d\u4f7f\u7528\u8fde\u63a5\u6c60\u7684\u60c5\u51b5\u505a\u5bf9\u6bd4<\/strong><\/span><\/h6>\n<pre class=\"lang:default decode:true \">package com.ixyzero.learn.db;\r\n\r\nimport com.mchange.v2.c3p0.ComboPooledDataSource;\r\n\r\nimport java.beans.PropertyVetoException;\r\nimport java.sql.Connection;\r\nimport java.sql.DriverManager;\r\nimport java.sql.PreparedStatement;\r\nimport java.sql.ResultSet;\r\n\r\n\/**\r\n * Created by ixyzero.com on 2018\/6\/11.\r\n *\/\r\npublic class TestProperties {\r\n    \/\/ JDBC \u9a71\u52a8\u540d\u53ca\u6570\u636e\u5e93 URL\r\n    static final String JDBC_DRIVER = \"com.mysql.jdbc.Driver\";\r\n    static final String DB_URL = \"jdbc:mysql:\/\/localhost:3306\/test\";\r\n    \/\/ \u6570\u636e\u5e93\u7684\u7528\u6237\u540d\u4e0e\u5bc6\u7801\uff0c\u9700\u8981\u6839\u636e\u81ea\u5df1\u7684\u8bbe\u7f6e\r\n    static final String USER = \"root\";\r\n    static final String PASS = \"123456\";\r\n\r\n    private static ComboPooledDataSource datasource = new ComboPooledDataSource();\r\n\r\n    public static void main(String[] args) {\r\n        \/\/ jdbc without using connection pool\r\n        try {\r\n            for (int i = 0; i &lt; 100; i++) {\r\n                long beginTime = System.currentTimeMillis();\r\n\r\n                Class.forName(JDBC_DRIVER);\r\n\r\n                Connection con = DriverManager.getConnection(DB_URL, USER, PASS);\r\n                String sql = \"select * from websites\";\r\n                PreparedStatement ps = con.prepareStatement(sql);\r\n                ResultSet rs = ps.executeQuery();\r\n                while (rs.next()) {\r\n                    \/\/ System.out.println(rs.getString(1));\r\n                }\r\n                con.close();\r\n                long endTime = System.currentTimeMillis();\r\n                System.out.println(String.format(\"\u7b2c%s\u6b21, %s (ms)\", i, (endTime - beginTime)));\r\n            }\r\n        } catch (Exception e) {\r\n            e.printStackTrace();\r\n        }\r\n        System.out.println(\"\\n\");\r\n\r\n\r\n        datasource.setUser(USER);\r\n        datasource.setPassword(PASS);\r\n        datasource.setJdbcUrl(DB_URL);\r\n        try {\r\n            datasource.setDriverClass(JDBC_DRIVER);\r\n        } catch (PropertyVetoException e) {\r\n            e.printStackTrace();\r\n        }\r\n        datasource.setInitialPoolSize(20);\r\n        datasource.setMinPoolSize(1);\r\n        datasource.setAcquireIncrement(5);\r\n        datasource.setMaxPoolSize(100);\r\n        datasource.setMaxStatements(50);\r\n        datasource.setMaxIdleTime(60);\r\n        \/\/ use c3p0 connection pool\r\n        try {\r\n            for (int i = 0; i &lt; 100; i++) {\r\n                long beginTime = System.currentTimeMillis();\r\n                Connection con = datasource.getConnection();\r\n                \/\/ \u6267\u884c\u67e5\u8be2\u8bed\u53e5\r\n                String sql = \"select * from websites\";\r\n                PreparedStatement ps = con.prepareStatement(sql);\r\n                ResultSet rs = ps.executeQuery();\r\n                while (rs.next()) {\r\n                    \/\/ System.out.println(rs.getString(1));\r\n                }\r\n                con.close();\r\n                long endTime = System.currentTimeMillis();\r\n                System.out.println(String.format(\"[c3p0]\u7b2c%s\u6b21, %s (ms)\", i, (endTime - beginTime)));\r\n            }\r\n        } catch (Exception e) {\r\n            e.printStackTrace();\r\n        }\r\n\r\n    }\r\n}<\/pre>\n<p>MySQL\u5728\u9ad8\u7248\u672c\u9700\u8981\u6307\u660e\u662f\u5426\u8fdb\u884cSSL\u8fde\u63a5\uff0c\u672a\u914d\u7f6euseSSL\u65f6\u8b66\u544a\u4fe1\u606f\u6b63\u597d\u53ef\u4ee5\u7528\u6765\u663e\u793a\u4e00\u6b21\u8fde\u63a5\u3002\u4ece\u5b9e\u9645\u8fd0\u884c\u65e5\u5fd7\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c\u5f53\u4f7f\u7528\u8fde\u63a5\u65f6\uff0c\u7a0b\u5e8f\u5728\u542f\u52a8\u65f6\u76f4\u63a5\u5efa\u7acb\u4e8620\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff08\u5982\u679c\u4e0d\u663e\u5f0f\u6307\u5b9a\u7684\u8bdd\uff0c\u9ed8\u8ba4\u662f3\u4e2a\uff09\uff0c\u63a5\u4e0b\u6765\u7684\u6570\u636e\u5e93\u64cd\u4f5c\u901a\u8fc7\u8fde\u63a5\u6c60\u4e2d\u7684\u8fde\u63a5\u64cd\u4f5c\u6570\u636e\u5e93\uff0c\u4e0d\u518d\u65b0\u5efa\u8fde\u63a5\u3002\u800c\u4e0d\u4f7f\u7528\u8fde\u63a5\u6c60\u65f6\uff0c\u6bcf\u4e00\u6b21\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u5efa\u7acb\u4e86\u4e00\u6b21\u6570\u636e\u5e93\u8fde\u63a5\u3002<\/p>\n<p>\u4ece\u4e0a\u9762\u7684\u6d4b\u8bd5\u4e5f\u53ef\u4ee5\u770b\u51fa\u2014\u2014\u4f7f\u7528\u8fde\u63a5\u6c60\u7684\u64cd\u4f5c\u8017\u65f6\u660e\u663e\u77ed\u4e8e\u6bcf\u6b21\u65b0\u5efa\u8fde\u63a5\u7684\u64cd\u4f5c\uff0c\u6240\u4ee5\uff0c\u5bf9\u4e8e\u5b58\u5728\u591a\u4e2a\u8fde\u63a5\u7684\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528\u8fde\u63a5\u6c60\u53ef\u4ee5\u5e26\u6765\u6781\u5927\u7684\u6548\u7387\u63d0\u5347\u3002<\/p>\n<h5 id=\"id-\u6a21\u677f-\u53c2\u8003\u94fe\u63a5\uff1a\">\u53c2\u8003\u94fe\u63a5\uff1a<\/h5>\n<ul>\n<li><a href=\"https:\/\/blog.csdn.net\/wqc19920906\/article\/details\/72825793\">Java \u6570\u636e\u5e93\u7cfb\u5217\u6559\u7a0b&#8211;C3P0\u8be6\u89e3<\/a> #\u6574\u4f53\u8fd8\u884c\uff0c\u5c31\u662f\u6587\u4ef6\u4f4d\u7f6e\u7684\u63cf\u8ff0\u6709\u9519\u8bef\uff0c\u5bb3\u6211\u8c03\u4e86\u597d\u957f\u65f6\u95f4<\/li>\n<li><a href=\"http:\/\/hxblog.site\/2018\/05\/01\/c3p0%E8%BF%9E%E6%8E%A5%E6%B1%A0\/\">c3p0\u8fde\u63a5\u6c60<\/a><\/li>\n<li><a href=\"https:\/\/www.cnblogs.com\/mousewheel\/p\/6660238.html\">java \u5229\u7528c3p0\u7ba1\u7406\u6570\u636e\u5e93\u8fde\u63a5\u6c60<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/wang_shuyu\/article\/details\/53574839\">Java\u4f7f\u7528c3p0\u5efa\u7acbMySQL\u6570\u636e\u5e93\u8fde\u63a5\u6c60<\/a><\/li>\n<li><a href=\"http:\/\/mvnrepository.com\/artifact\/com.mchange\/c3p0\/0.9.5.2\">c3p0\u7684Maven\u914d\u7f6e<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/zhoucheng05_13\/article\/details\/53352003\">c3p0\u8fde\u63a5\u6c60\u8fde\u63a5\u5931\u8d25<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/ailo555\/article\/details\/50783465\">c3p0 \u914d\u7f6e\u8fde\u63a5MySQL\u5f02\u5e38<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/jdfkldjlkjdl\/article\/details\/42170749\">\u89e3\u51b3\uff1aConnections could not be acquired from the underlying database!<\/a><\/li>\n<li><a href=\"https:\/\/stackoverflow.com\/questions\/19035407\/classloader-getresourceasstream-returns-null\">https:\/\/stackoverflow.com\/questions\/19035407\/classloader-getresourceasstream-returns-null<\/a><\/li>\n<\/ul>\n<p>=END=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=Start= \u7f18\u7531\uff1a \u5728\u5b66\u4e60Java\u7684\u8fc7\u7a0b\u4e2d\u4e0d\u65ad\u7528\u6587\u7ae0\u8fdb\u884c\u6574\u7406\u603b\u7ed3\uff08\u5e38\u7528\u529f\u80fd\u7684Java\u5b9e\u73b0\uff09\uff0c\u4e89\u53d6\u65e9\u65e5\u80fd\u8f83\u4e3a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,23,7],"tags":[1153,61,16],"class_list":["post-3980","post","type-post","status-publish","format-standard","hentry","category-database","category-knowledgebase-2","category-programing","tag-c3p0","tag-java","tag-mysql"],"views":5880,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3980","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=3980"}],"version-history":[{"count":1,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3980\/revisions"}],"predecessor-version":[{"id":3981,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/3980\/revisions\/3981"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=3980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=3980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=3980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}