</frameset>
<frameset rows="*,119" cols="*" framespacing="0" frameborder="yes">
<frame src="leave.jsp" frameborder="1" scrolling="no" noresize="noresize">
</frameset>
</frameset>
6.2.9 友情链接管理模块教师还可将自己知道的一些好的网站添加到网站里,把友情链接的网名和网址添加进去,学生会在页面上看见添加进的网站名字,用户可以点网站名进入相应的网站。
为了方便管理和安全,将所有的sql语句都封装在一个Sql类中,并且每条语句都定义成public static final类的,这样就不允许有别的语句继承它们。具体的代码如下:
public final class Sql {
//用户登录
public static final String login_tb_user = "select count(*) from tb_user where user_name=? and user_password=?";
//用户注册向数库数中增加数据
public static final String registAdd_tb_user ="insert into tb_user (user_name,user_password,realname,email)" +"values( ?, ?, ?, ? )";
// public static final String queryId_tb_user ="select user_id from tb_user where user_name=?";
public static final String registCheck_tb_user="select count(*) from tb_user where user_name=?";
public static final String add_tb_articleType="insert into tb_articleType (typeName,description) values(?,?)";
public static final String query_tb_articleType="select * from tb_articleType";
public static final String del_tb_articleType="delete from tb_articleType where type_id=?";
public static final String add_tb_article="insert into tb_article (title,type_id,content,phTime,number) values(?,?,?,?,?)";
public static final String del_tb_article="delete from tb_article where article_id=?";
public static final String query_Article="select * from tb_article";
public static final String show_Article="select tb_article.*,tb_articleType.* from tb_article,tb_articleType where (tb_article.type_id=tb_articleType.type_id and tb_article.type_id=? and article_id=?)";
public static final String xin="select tb_article.*,typeName,description from tb_article left join tb_articleType on (tb_article.type_id=tb_articleType.type_id)";
public static final String add_tb_note="insert into tb_note (note_title,note_content,note_time) values(?,?,?)";
public static final String query_tb_note="select * from tb_note";
public static final String del_tb_note="delete from tb_note where note_id=?";
public static final String show_tb_note="select * from tb_note where note_id=?";
public static final String update_tb_note="update tb_note set note_content=? ,note_time=? where note_id=?";
public static final String update_tb_article= "update tb_article set content=? ,phTime=? where article_id=?";
public static final String query_tb_user = "select user_id,user_name,realname,email from tb_user";
public static final String del_tb_user = "delete from tb_user where user_id=?";
public static final String query_tb_message = "select * from tb_message order by mes_id";
public static final String delone_tb_message = "delete from tb_message where mes_id=?";
public static final String delall_tb_message = "delete from tb_message";
public static final String reply_tb_message = "insert into tb_message (mes_content,mes_sender,mes_sendTime,to_whom) values(?,?,?,?,?)";
public static final String add_tb_link = "insert into tb_link (link_name,link_add) values (?,?)";
public static final String del_tb_link = "delete from tb_link where link_id=?";
public static final String query_tb_link = "select link_id,link_name,link_add from tb_link";
// public static final String part_Article = "select article_id,title,content,phTime,number from tb_article order by article_id desc";
public static final String part_Article = "select article_id,title,content,phTime,number,typeName from tb_article left join tb_articleType on (tb_article.type_id=tb_articleType.type_id) order by article_id desc";
public static final String show_link = "select * from tb_link ";
public static final String show_note = "select * from tb_note order by note_id desc";
public static final String add_tb_video = "insert into tb