📄 delettompic.java
字号:
package hcit.common;
import hcit.common.DBConnect;
import java.util.ArrayList;
import java.sql.ResultSet;
import hcit.common.ReturnIopic_Pojo;
import java.util.Date;
import java.text.SimpleDateFormat;
public class delettompic {
public delettompic() {
}
public int deletemaintopic(String mtopic){
DBConnect db=new DBConnect() ;
int jie=0;
try {
jie=db.executeUpdate("delete MainTopic where M_TOPICID='"+mtopic+"'");
} catch (Exception ex) {
System.out.println(ex);
}
return jie;
}
public ArrayList QueryRtopic(String mtopic){
DBConnect db=new DBConnect() ;
ArrayList list=new ArrayList() ;
ResultSet rs=null;
try {
rs=db.executeQuery("select * from returntopic where M_TOPICID='"+mtopic+"'");
while(rs.next()){
ReturnIopic_Pojo poj=new ReturnIopic_Pojo() ;
poj.setR_topicid(rs.getString("R_TOPICID"));
poj.setM_topicid(rs.getString("M_TOPICID"));
poj.setC_date(rs.getDate("C_DATE"));
poj.setContent(rs.getString("CONTENT"));
poj.setUp(rs.getInt("UP"));
poj.setDown(rs.getInt("DOWN"));
poj.setFace_adress(rs.getString("FACE_ADREE"));
list.add(poj);
}
} catch (Exception ex) {
System.out.println(ex);
}
return list;
}
public int adddreturntopic(String mtopic,String connt,String tic){
DBConnect db=new DBConnect() ;
int jie=0;
Date currentTime = new Date();
SimpleDateFormat HMFromat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String strCurrentTime = HMFromat.format(currentTime);
try {
jie=db.executeUpdate("insert into returntopic(M_TOPICID,C_DATE,CONTENT,FACE_ADREE) values ('"+mtopic+"','"+strCurrentTime+"','"+connt+"','"+tic+"')");
} catch (Exception ex) {
System.out.println(ex);
}
return jie;
}
public int addzhichimaintopic(String id){
DBConnect db=new DBConnect() ;
int jie=0;
try {
jie=db.executeUpdate("update returntopic set up=up+1 where R_TOPICID='"+id+"'");
} catch (Exception ex) {
System.out.println(ex);
}
return jie;
}
public int addfanduitopic(String id){
DBConnect db=new DBConnect() ;
int jie=0;
try {
jie=db.executeUpdate("update returntopic set down=down+1 where R_TOPICID='"+id+"'");
} catch (Exception ex) {
System.out.println(ex);
}
return jie;
}
public int addmaintopicnum(String id){
DBConnect db=new DBConnect() ;
int jie=0;
try {
jie=db.executeUpdate("update MainTopic set PNUM=PNUM+1 where M_TOPICID='"+id+"'");
} catch (Exception ex) {
System.out.println(ex);
}
return jie;
}
public int addmaintopiRnum(String id){
DBConnect db=new DBConnect() ;
int jie=0;
try {
jie=db.executeUpdate("update MainTopic set RNUM=RNUM+1 where M_TOPICID='"+id+"'");
} catch (Exception ex) {
System.out.println(ex);
}
return jie;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -