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

📄 pproj.java

📁 图书
💻 JAVA
字号:
package thizlinux.linuxhr;import java.sql.*;import java.text.*;import java.util.*;public class pproj {	private String uid="";	private String id="";	private String sdate="";	private String edate="";	private String projectname="";	private String softwareenv="";	private String hardwareenv="";	private String developtool="";	private String description="";	private String responsibility="";	private String sql;	private boolean status=true;	private Vector idl=new Vector();	private Vector sdatel=new Vector();	private Vector edatel=new Vector();	private Vector projectnamel=new Vector();	private Vector softwareenvl=new Vector();	private Vector hardwareenvl=new Vector();	private Vector developtooll=new Vector();	private Vector descriptionl=new Vector();	private Vector responsibilityl=new Vector();		public Iterator getIdl(){		return idl.iterator();	}	public Iterator getSdatel(){		return sdatel.iterator();	}	public Iterator getEdatel(){		return edatel.iterator();	}	public Iterator getProjectnamel(){		return projectnamel.iterator();	}	public Iterator getSoftwareenvl(){		return softwareenvl.iterator();	}	public Iterator getHardwareenvl(){		return hardwareenvl.iterator();	}	public Iterator getDeveloptooll(){		return developtooll.iterator();	}	public Iterator getDescriptionl(){		return descriptionl.iterator();	}	public Iterator getResponsibilityl(){		return responsibilityl.iterator();	}	public void setUid(String value){		this.uid=value;	}	public String getUid(){		return this.uid;	}		public void setId(String value){		this.id=value;		}	public String getId(){		return this.id;	}		public void setSdate(String value){		this.sdate=value;		}	public String getSdate(){		return this.sdate;	}		public void setEdate(String value){		this.edate=value;		}	public String getEdate(){		return this.edate;	}			public void setProjectname(String value){		this.projectname=value;		}	public String getProjectname(){		return this.projectname;	}			public void setSoftwareenv(String value){		this.softwareenv=value;		}	public String getSoftwareenv(){		return this.softwareenv;	}			public void setHardwareenv(String value){		this.hardwareenv=value;		}	public String getHardwareenv(){		return this.hardwareenv;	}			public void setDeveloptool(String value){		this.developtool=value;		}	public String getDeveloptool(){		return this.developtool;	}			public void setDescription(String value){		this.description=value;		}	public String getDescription(){		return this.description;	}			public void setResponsibility(String value){		this.responsibility=value;		}	public String getResponsibility(){		return this.responsibility;	}				public void refresh(){		DBconnect dbconn =new DBconnect();		idl.clear();		sdatel.clear();		edatel.clear();		projectnamel.clear();		softwareenvl.clear();		hardwareenvl.clear();		developtooll.clear();		descriptionl.clear();		responsibilityl.clear();		ResultSet rs=null;		try{			sql="select id,sdate,edate,projectname,softwareenv,"+				    "hardwareenv,developtool,description,responsibility "+                              "from tbl_pproj where uid='"+this.uid+"'";			rs=dbconn.executeQuery(sql);			while(rs.next()){				idl.add(pub.datachange(rs.getString("id")));				sdatel.add(pub.datachange(rs.getString("sdate")));				edatel.add(pub.datachange(rs.getString("edate")));				projectnamel.add(pub.datachange(rs.getString("projectname")));				softwareenvl.add(pub.datachange(rs.getString("softwareenv")));				hardwareenvl.add(pub.datachange(rs.getString("hardwareenv")));				developtooll.add(pub.datachange(rs.getString("developtool")));				descriptionl.add(pub.datachange(rs.getString("description")));				responsibilityl.add(pub.datachange(rs.getString("responsibility")));			}  					sql="select sdate,edate,projectname,softwareenv,hardwareenv,developtool,"+					   "description,responsibility "+					   "from tbl_pproj where id='"+this.id+"' and uid='" +this.uid+"'";			rs=dbconn.executeQuery(sql);			if(rs.next()){  				this.sdate=pub.datachange(rs.getString("sdate"));				this.edate=pub.datachange(rs.getString("edate"));                  				this.projectname=pub.datachange(rs.getString("projectname"));                  				this.softwareenv=pub.datachange(rs.getString("softwareenv"));                  				this.hardwareenv=pub.datachange(rs.getString("hardwareenv"));                  				this.developtool=pub.datachange(rs.getString("developtool"));                  				this.description=pub.datachange(rs.getString("description"));                  				this.responsibility=pub.datachange(rs.getString("responsibility"));                  			}			else{				reset();			}		}catch(Exception e){			System.out.println(e+",sql="+sql);			status=false;		}finally{			try{				if(rs!=null)rs.close();				if(dbconn!=null)dbconn.close();			}catch(Exception e){				System.out.println(e);			}		}			}	public boolean update(){		status=true;		 if(sdate==null||sdate.equalsIgnoreCase(""))                {                        return false;                }		DBconnect dbconn =new DBconnect();		try{			sql = "delete from tbl_pproj where uid='" + this.uid + "' and id='"+this.id+"'";			dbconn.executeUpdate(sql);			sql="insert into tbl_pproj(id,uid,sdate,edate,projectname,softwareenv,hardwareenv,developtool,"+                       "description,responsibility ) "+                       "values('',"+			    "'"+this.uid+"',"+			    "'"+this.sdate+"',"+			    "'"+this.edate+"',"+			    "'"+this.projectname+"',"+			    "'"+this.softwareenv+"',"+			    "'"+this.hardwareenv+"',"+			    "'"+this.developtool+"',"+			    "'"+this.description+"',"+			    "'"+this.responsibility+"')";			dbconn.executeUpdate(sql);			reset();		}catch(Exception e){			System.out.println(e+",sql="+sql);			status=false;		}finally{			try{				if(dbconn!=null)dbconn.close();			}catch(Exception e){				System.out.println(e);			}		}		return  status;		}	public boolean remove(){		status=true;		DBconnect dbconn =new DBconnect();		try{			sql = "delete from tbl_pproj where uid='" + this.uid + "' and id='"+this.id+"'";			dbconn.executeUpdate(sql);			this.id="";		}catch(Exception e){			System.out.println(e+",sql="+sql);			status=false;		}finally{			try{				if(dbconn!=null)dbconn.close();			}catch(Exception e){				System.out.println(e);			}		}		return  status;		}	public void reset(){		this.id="";		this.sdate="";		this.edate="";		this.projectname="";		this.softwareenv="";		this.hardwareenv="";		this.developtool="";		this.description="";		this.responsibility="";	}}

⌨️ 快捷键说明

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