📄 clubtopicpost.java
字号:
} topicTree = tTree; topicLayer += 1; bea = topicAdd(); return bea; //message=String.valueOf(topicReID); } public boolean topicAdd() throws Exception{ boolean bea = false; String sqlCommand = new String(); ResultSet rs; Connection con = bridge.getConnection();//数据库链接 try{ sqlCommand = "Insert Into GVclubTopic(topicReID, topicOrder, topicLayer, topicTree"; sqlCommand += ", topic, userName, ccID, ccID2, ccID1, moveCCID, topicList"; sqlCommand += ", topicMood, topicPro, topicType, topicTypeNum, topicAddTime"; sqlCommand += ", topicAddip, topicLastReUser, topicLastReTime, topicViewCount, topicReCount, topicLen)"; sqlCommand += " Values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; PreparedStatement pps = con.prepareStatement(sqlCommand); pps.setInt(1, topicReID); pps.setInt(2, topicOrder); pps.setInt(3, topicLayer); pps.setInt(4, topicTree); pps.setString(5, topic); pps.setString(6, userName); pps.setInt(7, ccID); pps.setInt(8, ccID2); pps.setInt(9, ccID1); pps.setInt(10, moveCCID); pps.setString(11, topicColor + "|" + topicBold); pps.setInt(12, topicMood); pps.setInt(13, topicPro); pps.setInt(14, topicType); pps.setDouble(15, topicTypeNum); pps.setString(16, now); pps.setString(17, topicAddip); pps.setString(18, ""); pps.setString(19, now); pps.setInt(20, 0); pps.setInt(21, 0); pps.setInt(22, content.length()); pps.executeUpdate(); pps.close(); sqlCommand=""; sqlCommand = "Select topicID, topicReID From GVclubTopic order by topicID desc"; PreparedStatement pps0 = con.prepareStatement(sqlCommand); rs = pps0.executeQuery(); if(rs.next()){ topicID = rs.getInt(1); topicReID = rs.getInt(2); } rs.close(); pps0.close(); sqlCommand = ""; if(act.equals("add")){ sqlCommand = "Update GVclubTopic set topicReID="+ topicID +" where topicID="+ topicID+""; }else{ sqlCommand = "Update GVclubTopic set topicLastReTime='"+ now +"', topicLastReUser='"+ userName +"' where topicID="+ topicReID+""; } PreparedStatement pps2 = con.prepareStatement(sqlCommand); pps2.executeUpdate(); pps2.close(); sqlCommand=""; sqlCommand = "Insert Into GVclubContent(topicID, content, contentUserPen, contentUrl"; sqlCommand += ", contentImg, contentEmail, contentCopyRight)"; sqlCommand += " Values(?,?,?,?,?,?,?)"; PreparedStatement pps1 = con.prepareStatement(sqlCommand); pps1.setInt(1,topicID); pps1.setString(2,content); pps1.setInt(3, contentUserPen); pps1.setInt(4, contentUrl); pps1.setInt(5, contentImg); pps1.setInt(6, contentEmail); pps1.setInt(7, contentCopyRight); pps1.executeUpdate(); pps1.close(); con.close(); bea = true; if(topicReID>0){ ccu.counterUpdate(0, 0, 0, 1, 0, 0, 0, ""); }else{ ccu.counterUpdate(0, 0, 1, 0, 0, 0, 0, ""); } }catch(Exception e){ bea = false; con.close(); message = "系统出现意外错误,请重新尝试,如果不成功请联系在线勤杂工!"; }finally{ con.close(); } return bea; } public boolean userLogin() throws Exception{ boolean tempbea = false; if(!userPass.equals(userPass2)){ userPass = ens.encodeString("md5of16",userPass); } String sql = new String(); Connection con = bridge.getConnection(); try{ ResultSet rs; sql = "Select * From GVclubUsers "; sql += " where userName = ? and userPass=?" ; PreparedStatement pps = con.prepareStatement(sql); pps.setString(1, userName); pps.setString(2, userPass); rs = pps.executeQuery(); if(rs.next()){ tempbea = true ;//更新用户登录信息,取得返回值; }else{ message = "登陆失败,用户名或密码错误!"; tempbea = false; } rs.close(); pps.close(); }catch(Exception e){ message = "系统出现意外错误,请重新尝试,如果不成功请联系在线勤杂工!"; tempbea = false; con.close(); }finally{ con.close(); } return tempbea; } // public String getMessage(){ return this.message; } public int getTopicID(){ return this.topicID; } public void setTopicAddip(String addip){ this.topicAddip = addip; } public void setAct(String act){ this.act = act; } public void setContentUserPen(String contentUserPen){ if(contentUserPen!=null){ this.contentUserPen = Integer.parseInt(contentUserPen); }else{ this.contentUserPen = 0; } } public void setContentUrl(String contentUrl){ if(contentUrl!=null){ this.contentUrl = Integer.parseInt(contentUrl); }else{ this.contentUrl = 0; } } public void setContentImg(String contentImg){ if(contentImg!=null){ this.contentImg = Integer.parseInt(contentImg); }else{ this.contentImg = 0; } } public void setContentEmail(String contentEmail){ if(contentEmail!=null){ this.contentEmail = Integer.parseInt(contentEmail); }else{ this.contentEmail = 0; } } public void setContentCopyRight(String contentCopyRight){ if(contentCopyRight!=null){ this.contentCopyRight = Integer.parseInt(contentCopyRight); }else{ this.contentCopyRight = 0; } } public void setContent(String content){ if(content==null){ content = ""; } content = clubgb.Gb(content); this.content = content; } public void setUserName(String userName){ userName = clubgb.Gb(userName); this.userName = userName.trim(); } public void setUserPass(String userPass){ this.userPass = userPass; } public void setUserPass2(String userPass2){ this.userPass2 = userPass2; } public void setTopic(String topic){ topic = clubgb.Gb(topic); this.topic = topic; } public void setTopicID(int topicID){ this.topicID = topicID; } public void setTopicReID(int topicReID){ this.topicReID = topicReID; } public void setTopicColor(String topicColor){ if(topicColor==null || topicColor.equals("")){ topicColor="0"; } this.topicColor = topicColor; } public void setTopicBold(String topicBold){ if(topicBold==null){ topicBold="0"; } this.topicBold = topicBold; } public void setTopicType(int topicType){ this.topicType = topicType; } public void setTopicTypeNum(String topicTypeNum){ if(topicTypeNum!=null){ this.topicTypeNum = Integer.parseInt(topicTypeNum); }else{ this.topicTypeNum=0; } } public void setTopicMood(String topicMood){ if(topicMood!=null){ this.topicMood = Integer.parseInt(topicMood); }else{ this.topicMood=1; } } public void setTopicPro(String topicPro){ this.topicPro = Integer.parseInt(topicPro); } public void setccID(String ccID){ this.ccID = Integer.parseInt(ccID); } public void setccID1(String ccID1){ this.ccID1 = Integer.parseInt(ccID1); } public void setccID2(String ccID2){ this.ccID2 = Integer.parseInt(ccID2); } public void setMoveCCID(String moveCCID){ this.moveCCID = Integer.parseInt(moveCCID); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -