⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 managercollegestudentinfo.java

📁 基于WEB的网上报名系统
💻 JAVA
字号:
package internetsignup;
import java.sql.*;
public class ManagerCollegeStudentInfo
{
	private String userName="";
	private String userPassword="";
	private String speciality="";	
	private String signSelect="";
	private String sname="";
	private String sex="";
	private String birthday="";
	private String nation="";	
	private String identityNo="";
	private String ifMember="";
	private String ownAddress="";
	private String graduateSchool="";
	private String signType="";
	private String address="";
	private String mailNo="";
	private String fatherName="";
	private String fatherJob="";
	private String fatherPhone="";
	private String motherName="";
	private String motherJob="";
	private String motherPhone="";	
	private String cultureExtent="";
	private String score="";
	private String housePhone="";
	private String mobile="";
	private String remark="";	
	private String schoolOpinion="";	
	private String signupDate="";	

	Connection conn=null;
	ResultSet rs=null;
	Statement stmt=null;
	
	public void setUserName(String userName)
	{
		this.userName=userName;	
	}
	
	public void setUserPassword(String userPassword)
	{
		this.userPassword=userPassword;	
	}
	
	public void setSpeciality(String speciality)
	{
		this.speciality=speciality;	
	}
	
	public void setSignSelect(String signSelect)
	{
		this.signSelect=signSelect;	
	}
			
	public void setSname(String sname)
	{
		this.sname=sname;	
	}
	
	public void setSex(String sex)
	{
		this.sex=sex;	
	}
	
	public void setBirthday(String birthday)
	{
		this.birthday=birthday;	
	}
		
	public void setNation(String nation)
	{
		this.nation=nation;	
	}
	
	public void setIdentityNo(String identityNo)
	{
		this.identityNo=identityNo;	
	}
	
	public void setIfMember(String ifMember)
	{
		this.ifMember=ifMember;	
	}
		
	public void setOwnAddress(String ownAddress)
	{
		this.ownAddress=ownAddress;	
	}
	
	public void setGraduateSchool(String graduateSchool)
	{
		this.graduateSchool=graduateSchool;	
	}	
	
	public void setSignType(String signType)
	{
		this.signType=signType;	
	}
	
	public void setAddress(String address)
	{
		this.address=address;	
	}
	
	public void setMailNo(String mailNo)
	{
		this.mailNo=mailNo;	
	}
	
	public void setFatherName(String fatherName)
	{
		this.fatherName=fatherName;	
	}
	
	public void setFatherJob(String fatherJob)
	{
		this.fatherJob=fatherJob;	
	}
	
	public void setFatherPhone(String fatherPhone)
	{
		this.fatherPhone=fatherPhone;	
	}
	
	public void setMotherName(String motherName)
	{
		this.motherName=motherName;	
	}
	
	public void setMotherJob(String motherJob)
	{
		this.motherJob=motherJob;	
	}
	
	public void setMotherPhone(String motherPhone)
	{
		this.motherPhone=motherPhone;	
	}	
	
	public void setCultureExtent(String cultureExtent)
	{
		this.cultureExtent=cultureExtent;	
	}
		
	public void setScore(String score)
	{
		this.score=score;	
	}	
		
	public void setHousePhone(String housePhone)
	{
		this.housePhone=housePhone;	
	}
		
	public void setMobile(String mobile)
	{
		this.mobile=mobile;	
	}
	
	public void setRemark(String remark)
	{
		this.remark=remark;	
	}
	
	public void setSchoolOpinion(String schoolOpinion)
	{
		this.schoolOpinion=schoolOpinion;	
	}
		
	public void setSignupDate(String signupDate)
	{
		this.signupDate=signupDate;	
	}
		
	public String getUserName()
	{
		return userName;	
	}
	
	public String getUserPassword()
	{
		return userPassword;	
	}
	
	public String getSpeciality()
	{
		return speciality;	
	}
	
	public String getSignSelect()
	{
		return signSelect;	
	}
		
	public String getSname()
	{
		return sname;	
	}
	
	public String getSex()
	{
		return sex;	
	}
	
	public String getBirthday()
	{
		return birthday;	
	}
	
	public String getNation()
	{
		return nation;	
	}
	
	public String getIdentityNo()
	{
		return identityNo;	
	}

	public String getIfMember()
	{
		return ifMember;	
	}
	
	public String getOwnAddress()
	{
		return ownAddress;	
	}
		
	public String getGraduateSchool()
	{
		return graduateSchool;	
	}
	
	public String getSignType()
	{
		return signType;	
	}
		
	public String getAddress()
	{
		return address;	
	}
	
	public String getMailNo()
	{
		return mailNo;	
	}
	
	public String getFatherName()
	{
		return fatherName;	
	}
	
	public String getFatherJob()
	{
		return fatherJob;	
	}
	
	public String getFatherPhone()
	{
		return fatherPhone;	
	}
	
	public String getMotherName()
	{
		return motherName;	
	}
	
	public String getMotherJob()
	{
		return motherJob;	
	}
	
	public String getMotherPhone()
	{
		return motherPhone;	
	}
	public String getCultureExtent()
	{
		return cultureExtent;	
	}	

	public String getScore()
	{
		return score;	
	}
	
	public String getHousePhone()
	{
		return housePhone;	
	}
	
	public String getMobile()
	{
		return mobile;	
	}
	
	public String getRemark()
	{
		return remark;	
	}
	
	public String getSchoolOpinion()
	{
		return schoolOpinion;	
	}
	
	public String getSignupDate()
	{
		return signupDate;	
	}
	
	public ManagerCollegeStudentInfo()
	{
		try
		{
			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");				
		}
		catch(ClassNotFoundException e)
		{
			System.out.println(e);	
		}
	}
	
	public int selectUserNameMessage()
	{
		try
		{
			conn=DriverManager.getConnection("jdbc:odbc:College","njgcxx","njgcxx");	
			stmt=conn.createStatement();
			String sql="select * from CollegeStudentInfo where userName='"+userName+"'";
			rs=stmt.executeQuery(sql);
			if(rs.next())
			{
				userPassword=rs.getString("userPassword").trim();
				speciality=rs.getString("speciality").trim();
				signSelect=rs.getString("signSelect").trim();
				sname=rs.getString("sname").trim();
				sex=rs.getString("sex").trim();
				birthday=rs.getString("birthday").trim();
				nation=rs.getString("nation").trim();
				identityNo=rs.getString("identityNo").trim();
				ifMember=rs.getString("ifMember").trim();
				ownAddress=rs.getString("ownAddress").trim();
				graduateSchool=rs.getString("graduateSchool").trim();
				signType=rs.getString("signType").trim();
				address=rs.getString("address").trim();
				mailNo=rs.getString("mailNo").trim();
				fatherName=rs.getString("fatherName").trim();
				fatherJob=rs.getString("fatherJob").trim();
				fatherPhone=rs.getString("fatherPhone").trim();
				motherName=rs.getString("motherName").trim();
				motherJob=rs.getString("motherJob").trim();
				motherPhone=rs.getString("motherPhone").trim();				
				cultureExtent=rs.getString("cultureExtent").trim();
				score=rs.getString("score").trim();
				housePhone=rs.getString("housePhone").trim();
				mobile=rs.getString("mobile").trim();
				remark=rs.getString("remark").trim();
				schoolOpinion=rs.getString("schoolOpinion").trim();
				signupDate=rs.getString("signupDate").trim();
				return 1;
			}
			else
			{
				return 0;	
			}
		}	
		catch(Exception e)
		{			
			return 0;
		}
		finally
        {
        	try{rs.close();stmt.close();conn.close();}
        	catch(Exception e){}
        }  
	}
	
	public int selectSignupDateMessage()
	{
		try
		{
			conn=DriverManager.getConnection("jdbc:odbc:College","njgcxx","njgcxx");			
			stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
			String sql="select * from CollegeStudentInfo where signupDate='"+signupDate+"'";
			rs=stmt.executeQuery(sql);					
			if(rs.next())
			{
				userName=rs.getString("userName").trim();
				userPassword=rs.getString("userPassword").trim();
				speciality=rs.getString("speciality").trim();
				signSelect=rs.getString("signSelect").trim();
				sname=rs.getString("sname").trim();
				sex=rs.getString("sex").trim();
				birthday=rs.getString("birthday").trim();
				nation=rs.getString("nation").trim();
				identityNo=rs.getString("identityNo").trim();
				ifMember=rs.getString("ifMember").trim();
				ownAddress=rs.getString("ownAddress").trim();
				graduateSchool=rs.getString("graduateSchool").trim();
				signType=rs.getString("signType").trim();
				address=rs.getString("address").trim();
				mailNo=rs.getString("mailNo").trim();
				fatherName=rs.getString("fatherName").trim();
				fatherJob=rs.getString("fatherJob").trim();
				fatherPhone=rs.getString("fatherPhone").trim();
				motherName=rs.getString("motherName").trim();
				motherJob=rs.getString("motherJob").trim();
				motherPhone=rs.getString("motherPhone").trim();				
				cultureExtent=rs.getString("cultureExtent").trim();
				score=rs.getString("score").trim();
				housePhone=rs.getString("housePhone").trim();
				mobile=rs.getString("mobile").trim();
				remark=rs.getString("remark").trim();
				schoolOpinion=rs.getString("schoolOpinion").trim();
				signupDate=rs.getString("signupDate").trim();
				return 1;
			}
			else
			{
				userName="";
				userPassword="";
				speciality="";	
				signSelect="";
				sname="";
				sex="";
				birthday="";
				nation="";	
				identityNo="";
				ifMember="";
				ownAddress="";
				graduateSchool="";
				signType="";
				address="";
				mailNo="";
				fatherName="";
				fatherJob="";
				fatherPhone="";
				motherName="";
				motherJob="";
				motherPhone="";	
				cultureExtent="";
				score="";
				housePhone="";
				mobile="";
				remark="";	
				schoolOpinion="";	
				signupDate="";	
				return 0;	
			}
		}	
		catch(Exception e)
		{			
			return 0;
		}
	}
	
	public int count()
	{
		int i=1;
		try
		{
			while(rs.next())
		    {
			    i++;
		    }
		    rs.first();		    
		    return i;
	    }
	    catch(Exception e){System.out.println(e.toString());return 0;}
		
	}
	
	public int MoveNextmessage()
	{
		try
		{
			if(rs.next())
			{
				userName=rs.getString("userName").trim();
				userPassword=rs.getString("userPassword").trim();
				speciality=rs.getString("speciality").trim();
				signSelect=rs.getString("signSelect").trim();
				sname=rs.getString("sname").trim();
				sex=rs.getString("sex").trim();
				birthday=rs.getString("birthday").trim();
				nation=rs.getString("nation").trim();
				identityNo=rs.getString("identityNo").trim();
				ifMember=rs.getString("ifMember").trim();
				ownAddress=rs.getString("ownAddress").trim();
				graduateSchool=rs.getString("graduateSchool").trim();
				signType=rs.getString("signType").trim();
				address=rs.getString("address").trim();
				mailNo=rs.getString("mailNo").trim();
				fatherName=rs.getString("fatherName").trim();
				fatherJob=rs.getString("fatherJob").trim();
				fatherPhone=rs.getString("fatherPhone").trim();
				motherName=rs.getString("motherName").trim();
				motherJob=rs.getString("motherJob").trim();
				motherPhone=rs.getString("motherPhone").trim();				
				cultureExtent=rs.getString("cultureExtent").trim();
				score=rs.getString("score").trim();
				housePhone=rs.getString("housePhone").trim();
				mobile=rs.getString("mobile").trim();
				remark=rs.getString("remark").trim();
				schoolOpinion=rs.getString("schoolOpinion").trim();
				signupDate=rs.getString("signupDate").trim();
				return 1;
			}
			else
			{
				userName="";
				userPassword="";
				speciality="";	
				signSelect="";
				sname="";
				sex="";
				birthday="";
				nation="";	
				identityNo="";
				ifMember="";
				ownAddress="";
				graduateSchool="";
				signType="";
				address="";
				mailNo="";
				fatherName="";
				fatherJob="";
				fatherPhone="";
				motherName="";
				motherJob="";
				motherPhone="";	
				cultureExtent="";
				score="";
				housePhone="";
				mobile="";
				remark="";	
				schoolOpinion="";	
				signupDate="";	
				return 0;	
			}
		}	
		catch(Exception e)
		{			
			return 0;
		}
	}
	
	public void closeMessage()
	{
		try
		{
			rs.close();
			stmt.close();
			conn.close();	
		}	
		catch(Exception e)
		{
			System.out.println(e.toString());
		}
	}
	
	public int updateMessage()
	{
		try
		{
			conn=DriverManager.getConnection("jdbc:odbc:College","njgcxx","njgcxx");	
			stmt=conn.createStatement();
			String sql="update CollegeStudentInfo set speciality='"+
			speciality+"',signSelect='"+signSelect+"',sname='"+sname+"',sex='"+sex+"',birthday='"
			+birthday+"',nation='"+nation+"',identityNo='"+identityNo+"',ifMember='"+ifMember+"',ownAddress='"+ownAddress+"',graduateSchool='"+graduateSchool+"',signType='"+signType
			+"',address='"+address+"',mailNo='"+mailNo+"',fatherName='"+fatherName+"',fatherJob='"+fatherJob+"',fatherPhone='"+fatherPhone+"',motherName='"
			+motherName+"',motherJob='"+motherJob+"',motherPhone='"+motherPhone+"',cultureExtent='"+cultureExtent+"',score='"+score
			+"',housePhone='"+housePhone+"',mobile='"+mobile+"',remark='"+remark+"',schoolOpinion='"+schoolOpinion+"' where userName='"+userName+"'";
			int i=stmt.executeUpdate(sql);			
			return i;
		}	
		catch(Exception e)
		{
			System.out.println(e);
			return 0;
		}	
		finally
        {
        	try{stmt.close();conn.close();}
        	catch(Exception e){}
        }  
	}
	
	public int deleteMessage()
	{
		try
		{
			conn=DriverManager.getConnection("jdbc:odbc:College","njgcxx","njgcxx");	
			stmt=conn.createStatement();
			String sql="delete from CollegeStudentInfo where userName='"+userName+"'";
			int i=stmt.executeUpdate(sql);
			return i;
		}	
		catch(Exception e)
		{
			System.out.println(e);
			return 0;
		}
		finally
        {
        	try{stmt.close();conn.close();}
        	catch(Exception e){}
        }  		
	}	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -