资源简介

个人博客 java web myeclipse 直接导入项目

资源截图

代码片段和文件信息

package com.wy.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.wy.form.ArticleForm;
import com.wy.tool.JDBConnection;

public class ArticleDao {
private JDBConnection connection = null;

private ArticleForm articleForm = null;

public ArticleDao() {
connection = new JDBConnection();
}

public boolean operationArticle(String operation ArticleForm form) {
boolean flag = false;
String sql = null;
if (operation.equals(“添加“))
sql = “insert into tb_article values (‘“ + form.getTypeId() + “‘‘“
+ form.gettitle() + “‘‘“ + form.getContent() + “‘‘“
+ form.getPhTime() + “‘‘“ + form.getNumber() + “‘)“;
if (operation.equals(“修改“))
sql = “update tb_article set typeID=‘“ + form.getTypeId()
+ “‘title=‘“ + form.gettitle() + “‘content=‘“
+ form.getContent() + “‘ where id=‘“ + form.getId() + “‘“;
if (operation.equals(“删除“))
sql = “delete from tb_article where id=‘“ + form.getId() + “‘“;
if (operation.equals(“增加“))
sql = “update tb_article set number=number+1 where id=‘“
+ form.getId() + “‘“;
if (connection.executeUpdate(sql)) {
flag = true;
}
return flag;
}

public List queryArticle(Integer typeId) {
List list = new ArrayList();
String sql = null;
if (typeId == null)
sql = “select * from tb_article“;
else
sql = “select * from tb_article where typeID=‘“ + typeId
+ “‘ order by id desc“;
ResultSet rs = connection.executeQuery(sql);
try {
while (rs.next()) {
articleForm = new ArticleForm();
articleForm.setId(rs.getInt(1));
articleForm.setTypeId(rs.getInt(2));
articleForm.settitle(rs.getString(3));
articleForm.setContent(rs.getString(4));
articleForm.setPhTime(rs.getString(5));
articleForm.setNumber(rs.getInt(6));
list.add(articleForm);
}
} catch (SQLException e) {
e.printStackTrace();
}
return list;
}

public ArticleForm queryArticleForm(Integer id) {
String sql = “select * from tb_article where id=‘“ + id + “‘“;
ResultSet rs = connection.executeQuery(sql);
try {
while (rs.next()) {
articleForm = new ArticleForm();
articleForm.setId(rs.getInt(1));
articleForm.setTypeId(rs.getInt(2));
articleForm.settitle(rs.getString(3));
articleForm.setContent(rs.getString(4));
articleForm.setPhTime(rs.getString(5));
articleForm.setNumber(rs.getInt(6));
}
} catch (SQLException e) {
e.printStackTrace();
}
this.operationArticle(“增加“ articleForm);
return articleForm;
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3870  2007-12-14 19:13  10\backMainPage.jsp

     文件       5282  2007-12-14 19:13  10\back_ArticleAdd.jsp

     文件       5132  2007-12-14 19:13  10\back_ArticleSelect.jsp

     文件       3003  2007-12-14 19:13  10\back_ArticleTypeAdd.jsp

     文件       4343  2007-12-14 19:13  10\back_ArticleTypeSelect.jsp

     文件       5780  2007-12-14 19:13  10\back_ArticleUpdate.jsp

     文件       3799  2007-12-14 19:13  10\back_consumerSelect.jsp

     文件       3828  2007-12-14 19:13  10\back_consumerSelectForm.jsp

     文件       5399  2007-12-14 19:13  10\back_consumerSelectHostForm.jsp

     文件       3461  2007-12-14 19:13  10\back_DiscussAdd.jsp

     文件       4183  2007-12-14 19:13  10\back_DiscussSelect.jsp

     文件       3631  2007-12-14 19:13  10\back_DiscussUpdate.jsp

     文件        366  2007-12-14 19:13  10\back_Down.jsp

     文件       3247  2007-12-14 19:13  10\back_FriendAdd.jsp

     文件       3600  2007-12-14 19:13  10\back_FriendSelect.jsp

     文件       3539  2007-12-14 19:13  10\back_FriendUpdate.jsp

     文件       6479  2007-12-15 10:16  10\back_Left.jsp

     文件       3757  2007-12-14 19:13  10\back_PhotoInsert.jsp

     文件       5563  2007-12-14 19:13  10\back_PhotoSelect.jsp

     文件       4333  2007-12-14 19:13  10\back_RestoreSelect.jsp

     文件       1300  2007-12-15 13:33  10\back_Top.jsp

     文件       2888  2007-12-14 19:13  10\back_VoteAdd.jsp

     文件       3824  2007-12-14 19:13  10\back_VoteSelect.jsp

     文件       2835  2007-12-14 19:13  10\consumer\accountAdd.jsp

     文件       4221  2007-12-15 13:24  10\CSS\style.css

     文件    1048576  2008-01-12 16:41  10\Database\db_BlodMay_Data.MDF

     文件    1048576  2008-01-12 16:41  10\Database\db_BlodMay_Log.LDF

     文件       1876  2007-12-14 19:13  10\dealwith.jsp

     文件     957344  2007-12-14 19:13  10\file\13.JPG

     文件     755748  2007-12-14 19:13  10\file\15.JPG

............此处省略157个文件信息

评论

共有 条评论