• 大小: 6.16M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-18
  • 语言: Java
  • 标签: 登录  验证  

资源简介


资源截图

代码片段和文件信息

package c3p0;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.mchange.v2.c3p0.ComboPooledDataSource;

public class C3p0Utils {
// 通过标识名来创建相应连接池
static ComboPooledDataSource dataSource = new ComboPooledDataSource(“mysql“);

// 从连接池中取用一个连接
public static Connection getConnection() {
try {
return dataSource.getConnection();

} catch (Exception e) {
throw new RuntimeException(“数据库连接出错!“ e);
}
}

public static void main(String[] args) {
System.out.println(getConnection());
}

// 释放连接回连接池
public static void close(Connection conn PreparedStatement pst
ResultSet rs) {
if (rs != null) {
try {
rs.close();
} catch (SQLException e) {
throw n

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-10-15 21:38  jiyan\
     文件        1093  2019-10-15 21:36  jiyan\.classpath
     文件        1330  2019-10-11 18:09  jiyan\.project
     目录           0  2019-10-15 18:56  jiyan\.settings\
     文件         522  2019-10-11 17:53  jiyan\.settings\.jsdtscope
     文件         364  2019-10-11 17:53  jiyan\.settings\org.eclipse.jdt.core.prefs
     文件         474  2019-10-11 17:53  jiyan\.settings\org.eclipse.wst.common.component
     文件         414  2019-10-11 17:53  jiyan\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2019-10-11 17:53  jiyan\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2019-10-11 17:53  jiyan\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2019-10-16 12:52  jiyan\WebRoot\
     目录           0  2019-10-15 18:56  jiyan\WebRoot\meta-INF\
     文件          39  2019-10-11 17:53  jiyan\WebRoot\meta-INF\MANIFEST.MF
     目录           0  2019-10-15 18:56  jiyan\WebRoot\WEB-INF\
     目录           0  2019-10-16 12:01  jiyan\WebRoot\WEB-INF\classes\
     文件        1098  2019-10-15 21:38  jiyan\WebRoot\WEB-INF\classes\c3p0-config.xml
     目录           0  2019-10-16 12:01  jiyan\WebRoot\WEB-INF\classes\com\
     目录           0  2019-10-16 12:01  jiyan\WebRoot\WEB-INF\classes\com\hc\
     目录           0  2019-10-16 17:54  jiyan\WebRoot\WEB-INF\classes\com\hc\jiyan\
     文件        1767  2019-10-16 12:03  jiyan\WebRoot\WEB-INF\classes\com\hc\jiyan\C3p0Utils.class
     文件         458  2019-10-16 12:09  jiyan\WebRoot\WEB-INF\classes\com\hc\jiyan\DBUtil_BO.class
     文件        1502  2019-10-16 12:09  jiyan\WebRoot\WEB-INF\classes\com\hc\jiyan\DBUtils.class
     文件         725  2019-10-16 12:01  jiyan\WebRoot\WEB-INF\classes\com\hc\jiyan\GeetestConfig.class
     文件       10822  2019-10-16 12:01  jiyan\WebRoot\WEB-INF\classes\com\hc\jiyan\GeetestLib.class
     文件        2162  2019-10-16 12:01  jiyan\WebRoot\WEB-INF\classes\com\hc\jiyan\StartCaptchaServlet.class
     文件        2083  2019-10-16 18:43  jiyan\WebRoot\WEB-INF\classes\com\hc\jiyan\TestC3P0.class
     文件        3513  2019-10-16 18:30  jiyan\WebRoot\WEB-INF\classes\com\hc\jiyan\VerifyLoginServlet.class
     文件        1891  2019-10-16 18:46  jiyan\WebRoot\WEB-INF\classes\com\hc\jiyan\ZhuceServlet.class
     目录           0  2019-10-16 11:36  jiyan\WebRoot\WEB-INF\lib\
     文件      497865  2019-10-15 21:38  jiyan\WebRoot\WEB-INF\lib\c3p0-0.9.5.2.jar
     文件        2721  2019-10-15 21:38  jiyan\WebRoot\WEB-INF\lib\c3p0-oracle-thin-extras-0.9.5.2.jar
............此处省略48个文件信息

评论

共有 条评论