@@ -0,0 +1,1949 @@
+package com.jdbc.dbutils;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.SQLException;%0Aimport com.mchange.v2.c3p0.ComboPooledDataSource;%0A%0Apublic class JdbcManager %7B%0A    //%E6%95%B0%E6%8D%AE%E5%BA%93%E7%94%A8%E6%88%B7%E5%90%8D  %0A    private static final String USERNAME = %22root%22;  %0A    //%E6%95%B0%E6%8D%AE%E5%BA%93%E5%AF%86%E7%A0%81  %0A    private static final String PASSWORD = %22root%22;  %0A    //%E9%A9%B1%E5%8A%A8%E4%BF%A1%E6%81%AF   %0A    private static final String DRIVER = %22com.mysql.jdbc.Driver%22;  %0A    //%E6%95%B0%E6%8D%AE%E5%BA%93%E5%9C%B0%E5%9D%80  %0A    private static final String JDBCURL = %22jdbc:mysql://localhost:3306/dataname%22;      %0A%09  //C3P0%E8%BF%9E%E6%8E%A5%E6%B1%A0%E6%95%B0%E6%8D%AE%E6%BA%90%0A    public static ComboPooledDataSource dataSource;  %0A    static %7B  %0A        try %7B  %0A            dataSource = new ComboPooledDataSource();  %0A            dataSource.setUser(USERNAME);  %0A            dataSource.setPassword(PASSWORD);  %0A            dataSource.setJdbcUrl(JDBCURL);  %0A            dataSource.setDriverClass(DRIVER);  %0A            dataSource.setInitialPoolSize(10);  %0A            dataSource.setMinPoolSize(5);  %0A            dataSource.setMaxPoolSize(50);  %0A            dataSource.setMaxStatements(100);  %0A            dataSource.setMaxIdleTime(60);  %0A        %7D catch (Exception e) %7B  %0A            e.printStackTrace();  %0A        %7D  %0A    %7D %0A%09%0A    /*%0A%09  //C3P0%E8%BF%9E%E6%8E%A5%E6%B1%A0 ,%E4%B9%9F%E5%8F%AF%E4%BB%A5%E9%87%87%E7%94%A8c3p0-config.xml%E9%85%8D%E7%BD%AE%E6%96%B9%E5%BC%8F%0A    //%E5%8F%AF%E6%94%BE%E7%BD%AE%E5%9C%A8: WebContent/WEB-INF/classes/%0A    //%E4%B8%94%E5%9C%A8eclipse%E9%87%8C%E6%8A%8A%E4%B8%8A%E8%BF%B0%E8%B7%AF%E5%BE%84%E9%85%8D%E7%BD%AE%E5%88%B0%EF%BC%9A%E8%BF%90%E8%A1%8C-%3E%E8%BF%90%E8%A1%8C%E9%85%8D%E7%BD%AE-%3EApache Tomcat-%3E%E7%B1%BB%E8%B7%AF%E5%BE%84CLASSPATH%E4%B8%8B%0A    public static ComboPooledDataSource dataSource;  %0A    static %7B  %0A        try %7B  %0A        %09  dataSource = new ComboPooledDataSource();//%E9%BB%98%E8%AE%A4%E7%9A%84%E7%BC%BA%E7%9C%81%E9%85%8D%E7%BD%AE%0A            //dataSource = new ComboPooledDataSource(%22mysql2%22);//%E5%88%AB%E5%90%8D%E6%96%B9%E5%BC%8F%0A        %7D catch (Exception e) %7B  %0A            e.printStackTrace();  %0A        %7D  %0A    %7D*/%0A    %0A    /** %0A     * %E4%BB%8EC3P0%E8%BF%9E%E6%8E%A5%E6%B1%A0%E4%B8%AD%E8%8E%B7%E5%8F%96%E6%95%B0%E6%8D%AE%E6%BA%90%E9%93%BE%E6%8E%A5%0A     * @return Connection %E6%95%B0%E6%8D%AE%E6%BA%90%E9%93%BE%E6%8E%A5 %0A     */  %0A    public static Connection getConnection() %7B%0A    %09Connection conn = null;  %0A        try %7B  %0A        %09conn = dataSource.getConnection();  %0A        %7D catch (SQLException e) %7B  %0A            e.printStackTrace();  %0A        %7D %0A        return conn;  %0A    %7D      %0A    %0A%7D%0A

Create JdbcManager.java