数据库课设 劳务信息管理系统


这是数据库课设做的,用的B/S系统,文档和sql文件都有
资源截图
代码片段和文件信息
package trouble.dao;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.apache.commons.dbutils.handlers.ScalarHandler;

import trouble.domain.Enterprise;
import trouble.utils.C3P0Util;

public class EnterpriseDao {

public int count(String category) throws SQLException {
QueryRunner qr = new QueryRunner(C3P0Util.getDataSource());
String sql = “select count(*) from enterprise“;
// 如果category不是空,就把条件加上
if (!““.equals(category)) {
sql += “ where nature=‘“ + category + “‘“;
}
long l = (Long) qr.query(sql new ScalarHandler(1));
return (int) l;
}

public List findEnterprises(int currentPage int pageSize String category) throws SQLException {
QueryRunner qr = new QueryRunner(C3P0Util.getDataSource());

String sql = “select * from enterprise where 1=1“;
List list = new ArrayList();
if (!““.equals(category)) {
sql += “ and nature=?“;
list.add(category);
}
sql += “ limit ??“;

list.add((currentPage - 1) * pageSize);
list.add(pageSize);

return qr.query(sql new BeanListHandler(Enterprise.class) list.toArray());
}

public Enterprise findEnterpriseById(String id) throws SQLException {
QueryRunner qr = new QueryRunner(C3P0Util.getDataSource());

return qr.query(“select * from enterprise where id=?“ new BeanHandler(Enterprise.class) id);
}

public List findEnterprise() throws SQLException {
QueryRunner qr = new QueryRunner(C3P0Util.getDataSource());
return qr.query(“select * from enterprise“ new BeanListHandler(Enterprise.class));
}

public List findEnterpriseByManyCondition(String id String category String name) throws SQLException {
QueryRunner qr = new QueryRunner(C3P0Util.getDataSource());
String sql = “select * from enterprise where 1=1“;
if (!““.equals(id.trim()))
sql += “ and id=‘“ + id + “‘“;
if (!““.equals(category.trim()))
sql += “ and nature=‘“ + category + “‘“;
if (!““.equals(name.trim()))
sql += “ and name=‘“ + name + “‘“;
// System.out.println(sql);
return qr.query(sql new BeanListHandler(Enterprise.class));
}

public void addEnterprise(String name String corporate String telephone String category String description
String img_url) throws SQLException {
QueryRunner qr = new QueryRunner(C3P0Util.getDataSource());
String sql = “INSERT INTO enterprise(NAMEnaturecorporateintroducetelephoneimg_url) VALUES(??????)“;
qr.update(sqlnamecategorycorporatedescriptiontelephoneimg_url);

}

public void updateEnterprise(String id String name String corporate String telephone String category
String description) throws SQLException {
QueryRunner qr = new QueryRunner(

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-07-04 10:25  laborInformation
     文件         842  2018-07-04 09:50  laborInformation.classpath
     目录           0  2018-07-04 10:28  laborInformation.git
     文件          13  2018-07-04 10:26  laborInformation.gitCOMMIT_EDITMSG
     文件         313  2018-07-04 10:28  laborInformation.gitconfig
     文件          73  2018-07-04 09:34  laborInformation.gitdescription
     文件         108  2018-07-04 09:50  laborInformation.gitFETCH_HEAD
     文件          23  2018-07-04 09:50  laborInformation.gitHEAD
     目录           0  2018-07-04 09:34  laborInformation.githooks
     文件         478  2018-07-04 09:34  laborInformation.githooksapplypatch-msg.sample
     文件         896  2018-07-04 09:34  laborInformation.githookscommit-msg.sample
     文件        3327  2018-07-04 09:34  laborInformation.githooksfsmonitor-watchman.sample
     文件         189  2018-07-04 09:34  laborInformation.githookspost-update.sample
     文件         424  2018-07-04 09:34  laborInformation.githookspre-applypatch.sample
     文件        1638  2018-07-04 09:34  laborInformation.githookspre-commit.sample
     文件        1348  2018-07-04 09:34  laborInformation.githookspre-push.sample
     文件        4898  2018-07-04 09:34  laborInformation.githookspre-rebase.sample
     文件         544  2018-07-04 09:34  laborInformation.githookspre-receive.sample
     文件        1492  2018-07-04 09:34  laborInformation.githooksprepare-commit-msg.sample
     文件        3610  2018-07-04 09:34  laborInformation.githooksupdate.sample
     文件       37585  2018-07-04 10:26  laborInformation.gitindex
     目录           0  2018-07-04 09:34  laborInformation.gitinfo
     文件         240  2018-07-04 09:34  laborInformation.gitinfoexclude
     目录           0  2018-07-04 09:36  laborInformation.gitlogs
     文件         861  2018-07-04 10:26  laborInformation.gitlogsHEAD
     目录           0  2018-07-04 09:43  laborInformation.gitlogs
efs
     目录           0  2018-07-04 09:36  laborInformation.gitlogs
efsheads
     文件         517  2018-07-04 10:26  laborInformation.gitlogs
efsheadsmaster
     目录           0  2018-07-04 09:45  laborInformation.gitlogs
efs
emotes
     目录           0  2018-07-04 09:50  laborInformation.gitlogs
efs
emotesorigin
     文件         456  2018-07-04 10:28  laborInformation.gitlogs
efs
emotesoriginmaster
............此处省略1003个文件信息

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

发表评论

评论列表(条)