📄 talk_c.java
字号:
package admin.talk;
import java.io.UnsupportedEncodingException;
import java.sql.*;
import java.util.*;
import zd.bbs.DataBaseConnection;
import zd.bbs.Note;
public class Talk_c{
private Connection con;
public Talk_c(){
DataBaseConnection dbc = new DataBaseConnection() ;
this.con=dbc.getConnection();
}
//��idɾ���¼
public void deleteTalk(String talk_id)throws Exception{
Statement stmt=con.createStatement();
stmt.execute("delete from talk where talk_id="+talk_id+"");
stmt.close();
}
//��id�Ų��ұ��������
public Note getTalk(String talk_id)throws Exception{
Statement stmt=con.createStatement();
String sql="select * from talk where talk_id="+talk_id+"";
sql=new String(sql.getBytes("ISO8859-1"), "GB2312");
ResultSet rst=stmt.executeQuery(sql);
Note note=null;
while(rst.next()){
note=new Note();
note.setTalk_id(rst.getInt("talk_id"));
note.setTitle(rst.getString("title"));
note.setTalk_content(rst.getString("talk_content"));
}
return note;
}
//����������
public void setJinghua(String talk_id) throws Exception{
Statement stmt=con.createStatement();
stmt.executeUpdate("update talk set make='j' where talk_id="+talk_id+"");
stmt.close();
}
//�����ö�
public void setZhiding(String talk_id) throws Exception{
Statement stmt=con.createStatement();
stmt.executeUpdate("update talk set make='z' where talk_id="+talk_id+"");
stmt.close();
}
// �ı��������
public void TalkEdit(String title, String talk_content,String talk_id) throws Exception{
Statement stmt=con.createStatement();
stmt.executeUpdate("update talk set title='"+title+"', talk_content='"+talk_content+"' where talk_id="+talk_id+"");
stmt.close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -