📄 plang.java
字号:
package thizlinux.linuxhr;import java.sql.*;import java.text.*;import java.util.*;public class plang { private String uid=""; private String id=""; private String language=""; private String level=""; private String sql; private boolean status=true; private Vector idl=new Vector(); private Vector languagel=new Vector(); private Vector levell=new Vector(); public Iterator getIdl(){ return idl.iterator(); } public Iterator getLanguagel(){ return languagel.iterator(); } public Iterator getLevell(){ return levell.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 setLanguage(String value){ this.language=value; } public String getLanguage(){ return this.language; } public void setLevel(String value){ this.level=value; } public String getLevel(){ return this.level; } public void refresh(){ DBconnect dbconn =new DBconnect(); idl.clear(); languagel.clear(); levell.clear(); ResultSet rs=null; try{ sql="select id,language,level from tbl_plang where uid='"+this.uid+"'"; rs=dbconn.executeQuery(sql); while(rs.next()){ idl.add(pub.datachange(rs.getString("id"))); languagel.add(pub.datachange(rs.getString("language"))); levell.add(pub.datachange(rs.getString("level"))); } sql="select language,level "+ "from tbl_plang where id='"+this.id+"' and uid='" +this.uid+"'"; rs=dbconn.executeQuery(sql); if(rs.next()){ this.language=pub.datachange(rs.getString("language")); this.level=pub.datachange(rs.getString("level")); } 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(language==null||language.equalsIgnoreCase("")) { return false; } DBconnect dbconn =new DBconnect(); try{ sql = "delete from tbl_plang where uid='" + this.uid + "' and id='"+this.id+"'"; dbconn.executeUpdate(sql); sql="insert into tbl_plang(id,uid,language,level) "+ "values('',"+ "'"+this.uid+"',"+ "'"+this.language+"',"+ "'"+this.level+"')"; 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_plang 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.language=""; this.level=""; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -