人脸识别登录demo源码


通过摄像头获取人脸进行注册,调用百度云人脸识别接口,将照片保存,登录时通过摄像头获取人脸进行登录
资源截图
代码片段和文件信息
package org.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

/**
 * 
 * 
 * 项目名称:test_face_photo 类名称:baseDao 类描述: 数据库连接共用类 创建人:Mu Xiongxiong
 * 创建时间:2017-9-22 下午6:56:18 修改人:Mu Xiongxiong 修改时间:2017-9-22 下午6:56:18 修改备注:
 * 
 * @version
 * 
 */
public class baseDao {

private static Connection con = null;

// 数据库驱动
private static String driver = “com.mysql.jdbc.Driver“;

// 连接字符串
private static String url = “jdbc:mysql://localhost:3306/facedb?characterEncoding=UTF-8“;

// 数据库用户名
private static String user = “root“;

// 密码
private static String pwd = “root“;

// 初始化PreparedStatement,编译sql语句
private static PreparedStatement ps = null;

// 初始化ResultSet数据集
private static ResultSet rs = null;

/**
 * 
 * @Description: 该方法的主要作用:打开连接,连接数据库
 * @title: getConnection
 * @param @return
 * @param @throws ClassNotFoundException
 * @param @throws SQLException 设定文件
 * @return 返回类型:Connection
 * @throws
 */
public static Connection getConnection() throws ClassNotFoundException
SQLException {
Class.forName(driver);
if (con == null) {
con = DriverManager.getConnection(url user pwd);
}
return con;
}

/**
 * 
 * @Description: 该方法的主要作用:增删改通用的方法
 * @title: executeUpdate
 * @param @param sql
 * @param @param prams
 * @param @return
 * @param @throws ClassNotFoundException
 * @param @throws SQLException 设定文件
 * @return 返回类型:int
 * @throws
 */
public static int executeUpdate(String sql Listject> prams)
throws ClassNotFoundException SQLException {
int rel = 0;
con = getConnection();
ps = con.prepareStatement(sql);
if (prams != null) {
for (int i = 0; i < prams.size(); i++) {
ps.setobject(i + 1 prams.get(i));
}
}
rel = ps.executeUpdate();
return rel;
}

/**
 * 
 * @Description: 该方法的主要作用:查询的通用方法
 * @title: executeQuery
 * @param @param sql
 * @param @param prams
 * @param @return 设定文件
 * @return 返回类型:ResultSet
 * @throws
 */
public static ResultSet executeQuery(String sql Listject> prams)
throws ClassNotFoundException SQLException {
con = getConnection();
ps = con.prepareStatement(sql);
if (prams != null) {
for (int i = 0; i < prams.size(); i++) {
ps.setobject(i + 1 prams.get(i));
}
}
rs = ps.executeQuery();
return rs;
}

/**
 * 
 * @Description: 该方法的主要作用:关闭资源
 * @title: closeConnnection
 * @param 设定文件
 * @return 返回类型:void
 * @throws
 */
public static void closeConnnection() {
// 关闭之前先判断是否为null
if (rs != null) {
try {
rs.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if (ps != null) {
try {
ps.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-19 11:01  test_face_photo
     文件         834  2018-04-19 11:01  test_face_photo.classpath
     文件        1048  2018-04-19 11:01  test_face_photo.project
     目录           0  2018-04-19 11:01  test_face_photo.settings
     文件         503  2018-04-19 11:01  test_face_photo.settings.jsdtscope
     文件         364  2018-04-19 11:01  test_face_photo.settingsorg.eclipse.jdt.core.prefs
     文件         497  2018-04-19 11:01  test_face_photo.settingsorg.eclipse.wst.common.component
     文件         345  2018-04-19 11:01  test_face_photo.settingsorg.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-04-19 11:01  test_face_photo.settingsorg.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-04-19 11:01  test_face_photo.settingsorg.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-04-19 14:00  test_face_photoWebContent
     目录           0  2018-04-19 11:01  test_face_photoWebContentmeta-INF
     文件          39  2018-04-19 11:01  test_face_photoWebContentmeta-INFMANIFEST.MF
     目录           0  2018-04-19 11:01  test_face_photoWebContentWEB-INF
     目录           0  2018-04-19 11:28  test_face_photoWebContentWEB-INFlib
     文件       86366  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibaliyun-java-sdk-core-3.2.3.jar
     文件       10550  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibaliyun-java-sdk-dysmsapi-1.0.0-SNAPSHOT.jar
     文件      443432  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibantlr-2.7.6.jar
     文件        4467  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibaopalliance.jar
     文件     1828687  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibaspectjweaver.jar
     文件      322553  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibcglib-nodep-2.2.3.jar
     文件      188671  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibcommons-beanutils-1.7.0.jar
     文件       91699  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibcommons-chain-1.2.jar
     文件      232771  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibcommons-codec-1.6.jar
     文件      575389  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibcommons-collections-3.2.1.jar
     文件      160519  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibcommons-dbcp-1.4.jar
     文件      148783  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibcommons-digester-2.0.jar
     文件       57779  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibcommons-fileupload-1.2.1.jar
     文件      305001  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibcommons-httpclient-3.1.jar
     文件      185140  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibcommons-io-2.4.jar
     文件      261809  2018-04-19 11:07  test_face_photoWebContentWEB-INFlibcommons-lang-2.4.jar
............此处省略103个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)