?? userinfo.java
字號:
package com.laoer.bbscs.user;import java.sql.*;import java.io.*;import java.util.*;import com.laoer.bbscs.db.*;import com.laoer.bbscs.txthtml.*;import com.laoer.bbscs.tool.MD5;/** * <p>Title: BBS-CS</p> * <p>Description: BBS-CS(BBS式虛擬社區系統)</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: loveroom.com.cn</p> * @author 龔天乙(laoer) * @version 3.0 */public class UserInfo { String SQL = ""; DbTrans DBSQL; ResultSet rs = null; private String strUserID = ""; private String strName = ""; private String strNick = ""; private String strPassWD = ""; private String strEmail = ""; private String strQuestion = ""; private String strAnswer = ""; private java.util.Date strLoginTime = null; private String strLiKai = ""; private int numCiShu = 0; private int numPost = 0; public UserInfo() { this.DBSQL = new DbTrans(); } public void setUserInfo(String strUID) { SQL = "select * from user where ID ="+strUID; try { rs = DBSQL.executeQuery(SQL); if (rs.next()) { this.strUserID = rs.getString("ID"); this.strName = rs.getString("name"); this.strNick = rs.getString("nick"); this.strPassWD = rs.getString("passwd1"); this.strEmail = rs.getString("email"); this.strQuestion = rs.getString("question"); this.strAnswer = rs.getString("answer"); this.strLoginTime = rs.getTimestamp("logintime"); this.strLiKai = rs.getString("likai"); this.numCiShu = rs.getInt("cishu"); this.numPost = rs.getInt("post"); } rs.close(); } catch (SQLException e){ } } public void setUserInfoName(String strUName) { SQL = "select * from user where name ='"+ strUName +"'"; try { rs = DBSQL.executeQuery(SQL); if (rs.next()) { this.strUserID = rs.getString("ID"); this.strName = rs.getString("name"); this.strNick = rs.getString("nick"); this.strPassWD = rs.getString("passwd1"); this.strEmail = rs.getString("email"); this.strQuestion = rs.getString("question"); this.strAnswer = rs.getString("answer"); this.strLoginTime = rs.getTimestamp("logintime"); this.strLiKai = rs.getString("likai"); this.numCiShu = rs.getInt("cishu"); this.numPost = rs.getInt("post"); } rs.close(); } catch (SQLException e){ } } public String getUserID() { return this.strUserID; } public String getUserName() { return this.strName; } public String getUserNick() { return this.strNick; } public String getUserPassWD() { return this.strPassWD; } public String getUserEmail() { return this.strEmail; } public String getUserQuestion() { return this.strQuestion; } public String getUserAnswer() { return this.strAnswer; } public java.util.Date getUserLoginTime() { return this.strLoginTime; } public String getUserLiKai() { return this.strLiKai; } public int getUserCiShu() { return this.numCiShu; } public int getUserPost() { return this.numPost; } public void close() { try { DBSQL.close(); } catch (SQLException e){ } }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -