?? userdata.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.*;/** * <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 UserData { String SQL = ""; DbTrans DBSQL; ResultSet rs = null; private int userExp = 0; private int userBx = 0; private int userArtNum = 0; private int userStayTime = 0; private int userNStayTime = 0; private int userPower = 0; private int userHPower = 0; public UserData() { this.DBSQL = new DbTrans(); } public void setUserData(String strUserID) { SQL = "select * from userdata where UID ="+strUserID; try { rs = DBSQL.executeQuery(SQL); if (rs.next()) { this.userExp = rs.getInt("exp"); this.userBx = rs.getInt("bx"); this.userArtNum = rs.getInt("artunm"); this.userStayTime = rs.getInt("staytime"); this.userNStayTime = rs.getInt("nstaytime"); this.userPower = rs.getInt("power"); this.userHPower = rs.getInt("hpower"); } rs.close(); } catch (SQLException e){ } } public int getUserExp() { return this.userExp; } public int getUserBx() { return this.userBx; } public int getUserArtNum() { return this.userArtNum; } public int getUserStatyTime() { return this.userStayTime; } public int getUserNStayTime() { return this.userNStayTime; } public int getUserPower() { return this.userPower; } public int getUserHPower() { return this.userHPower; } public void setUpdateUserData(String strUserID,String bx,String artunm,String power) { SQL = "update userdata set bx=bx"+bx+",artunm=artunm"+artunm+",power=power"+power+" where UID="+ strUserID; try { DBSQL.executeUpdate(SQL); } catch (SQLException e) { } } public void close() { try { DBSQL.close(); } catch (SQLException e) { } }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -