91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

上javaweb課時做的基于B/S模式的投票系統(tǒng),附帶寫好的課程設(shè)計報告,建好數(shù)據(jù)庫連上就能用(數(shù)據(jù)庫表的設(shè)計在設(shè)計報告中)。 開發(fā)環(huán)境:JDK1.8、eclipse、SQL server 2008 R2、TomCat 7.0 系統(tǒng)的用戶分為管理員用戶和普通用戶。 普通用戶提供以下功能:系統(tǒng)首頁上顯示所有投票選項的列表,顯示當(dāng)前登錄用戶并提供注銷功能,用戶可以通過選中某個選項并點擊“投票”按鈕進行投票操作。用戶點擊后可在當(dāng)前一頁面上看到各個投票選項目前的投票情況,主要包括各選項所得的票數(shù),并且以柱形顯示各選項的得票率,可以讓用戶從直觀上看到各項的得票情況。 管理員用戶提供以下功能:顯示當(dāng)前登錄用戶并提供注銷功能,提供系統(tǒng)管理實現(xiàn)用戶的增刪查改及重新投票等功能,還能顯示用戶列表及投票情況表。

資源截圖

代碼片段和文件信息

package?dao;

import?java.sql.Connection;
import?java.sql.DriverManager;
import?java.sql.PreparedStatement;
import?java.sql.ResultSet;
import?java.sql.Statement;
import?java.util.ArrayList;

import?vo.User;


public?class?UserDao?{
private?Connection?conn?=?null;
public?void?initConnection()?throws?Exception?{
Class.forName(“com.microsoft.sqlserver.jdbc.SQLServerDriver“);
conn?=?DriverManager.getConnection(“jdbc:sqlserver://localhost:1433;DatabaseName=Vote;user=root;password=123456789“);
}

//通過賬號查詢用戶***********************************************************************
public?User?getUserByAccount(String?account)?throws?Exception{
User?use?=?null;
initConnection();
String?sql=“SELECT?ACCOUNTPASSWORDUNAMEADMIN?FROM?T_USER?WHERE?ACCOUNT?=??“;
PreparedStatement?ps?=?conn.prepareStatement(sql);
ps.setString(1?account);
ResultSet?rs?=ps.executeQuery();
if(rs.next())?{
use?=?new?User();
use.setAccount(rs.getString(“ACCOUNT“));
use.setPassword(rs.getString(“PASSWORD“));
use.setUname(rs.getString(“UNAME“));
use.setAdmin(rs.getBoolean(“ADMIN“));
}
closeConnection();
return?use;
}


//獲取所有用戶***************************************************************************
public?ArrayList?getAllUsers()?throws?Exception{
ArrayList?al?=?new?ArrayList();
initConnection();
String?sql?=?“SELECT?ACCOUNT?UNAMETICKET?FROM?T_USER“;
Statement?stat?=?conn.createStatement();
ResultSet?rs?=?stat.executeQuery(sql);
while(rs.next())?{
User?user?=?new?User();
user.setAccount(rs.getString(“ACCOUNT“));
user.setUname(rs.getString(“UNAME“));
user.setTicket(rs.getInt(“TICKET“));
al.add(user);
}
closeConnection();
return?al;
}


//初始化用戶票數(shù)為1*********************************************************************
public?void?initTicket()?throws?Exception{
initConnection();
String?sql=“UPDATE?T_USER?SET?TICKET?=?1“;
PreparedStatement?ps?=?conn.prepareStatement(sql);
ps.executeUpdate();
closeConnection();
}



//添加用戶******************************************************************************
public?void?adduser(String?accountString?passwordString?unameString?admin)?throws?Exception{
initConnection();
int?adm;
if(admin.equals(“true“))?{
adm=1;
}
else?{
adm=0;
}
String?sql=“INSERT?INTO?T_USER?(ACCOUNT?PASSWORDUNAMEADMIN)?VALUES(????)“;
PreparedStatement?ps?=?conn.prepareStatement(sql);
ps.setString(1?account);
ps.setString(2?password);
ps.setString(3?uname);
ps.setInt(4?adm);
ps.executeUpdate();
closeConnection();
}


//刪除用戶******************************************************************************
public?void?deluser(String?account)?throws?Exception{
initConnection();
String?sql=“DELETE?FROM?T_USER?WHERE?ACCOUNT?=?“;
PreparedStatement?ps?=?conn.prepareStatement(sql);
ps.setString(1?account);
ps.executeUp

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????854??2019-07-01?15:55??Voting?System\.classpath
?????文件?????????913??2019-07-01?14:11??Voting?System\.project
?????文件?????????567??2019-07-01?14:11??Voting?System\.settings\.jsdtscope
?????文件?????????364??2019-07-01?14:11??Voting?System\.settings\org.eclipse.jdt.core.prefs
?????文件?????????491??2019-07-01?14:11??Voting?System\.settings\org.eclipse.wst.common.component
?????文件?????????305??2019-07-01?14:11??Voting?System\.settings\org.eclipse.wst.common.project.facet.core.xml
?????文件??????????49??2019-07-01?14:11??Voting?System\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2019-07-01?14:11??Voting?System\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件????????4641??2019-07-11?03:05??Voting?System\build\classes\dao\UserDao.class
?????文件????????3180??2019-07-11?03:05??Voting?System\build\classes\dao\VoteDao.class
?????文件????????1288??2019-07-11?03:05??Voting?System\build\classes\vo\User.class
?????文件?????????928??2019-07-11?03:05??Voting?System\build\classes\vo\Vote.class
?????文件????????4304??2019-07-09?17:26??Voting?System\src\dao\UserDao.java
?????文件????????1986??2019-07-09?15:36??Voting?System\src\dao\VoteDao.java
?????文件?????????771??2019-07-08?14:32??Voting?System\src\vo\User.java
?????文件?????????555??2019-07-01?15:23??Voting?System\src\vo\Vote.java
?????文件?????????987??2019-07-11?01:34??Voting?System\WebContent\addAction.jsp
?????文件????????1301??2019-07-11?00:54??Voting?System\WebContent\adduser.jsp
?????文件????????2249??2019-07-11?00:57??Voting?System\WebContent\admin.jsp
?????文件?????????935??2019-07-10?23:52??Voting?System\WebContent\changeAction.jsp
?????文件?????????546??2019-07-11?00:57??Voting?System\WebContent\changeError.jsp
?????文件?????????546??2019-07-11?00:57??Voting?System\WebContent\changeError2.jsp
?????文件?????????554??2019-07-11?01:37??Voting?System\WebContent\changeError3.jsp
?????文件????????1306??2019-07-11?00:57??Voting?System\WebContent\changeuser.jsp
?????文件????????2398??2019-07-10?21:34??Voting?System\WebContent\css\login.css
?????文件?????????882??2019-07-11?01:38??Voting?System\WebContent\delAction.jsp
?????文件?????????896??2019-07-11?00:57??Voting?System\WebContent\deluser.jsp
?????文件????????1504??2019-07-11?00:57??Voting?System\WebContent\display.jsp
?????文件??????113916??2019-07-11?00:46??Voting?System\WebContent\images\1.jpg
?????文件????????7254??2019-07-01?18:00??Voting?System\WebContent\images\bar.jpg
?????文件????????2308??2019-07-10?21:34??Voting?System\WebContent\images\login_logo.png
............此處省略11個文件信息

評論

共有 條評論

相關(guān)資源