administrator.java

来自「图书管管理系统是基于JAVA的 很好的」· Java 代码 · 共 58 行

JAVA
58
字号
/*
 * Administrator.java
 *
 * Created on 2007年11月22日, 上午10:47
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package h6.data;

import java.sql.ResultSet;
import java.sql.SQLException;
import h6.action.*;

/**
 *
 * @author dinga
 */
public class Administrator {
    
    /** Creates a new instance of Administrator */
    private String name;
    private String popedom;
    private String password;
    public Administrator() {
        
    }
    
    public void initializeReader() throws SQLException{
        DataBase db = new DataBase();
        String []s = {"*"};
        ResultSet rs =  db.search("administrator",s,"name = '" + name + "'");
        if (rs.next()){
            popedom = rs.getString(2);
            password = rs.getString(3);
        }
        rs.close();
        db.closeConnection();        
    }
    
    public void setName(String adName){
        name = adName;
    }
    
    public String getName(){
        return name;
    }
    
    public String getPopedom(){
        return popedom;
    }
    
    public String getPassword(){
        return password;
    }
}

⌨️ 快捷键说明

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