• 大小: 2.41MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-14
  • 语言: Java
  • 标签: java  jsp  源代码  连接池  

资源简介

启程家教网站 java jsp 源代码 连接池 sql server

资源截图

代码片段和文件信息

package admin;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class addNews extends HttpServlet {

/**
 * The doGet method of the servlet. 

 *
 * This method is called when a form has its tag value method equals to get.
 * 
 * @param request the request send by the client to the server
 * @param response the response send by the server to the client
 * @throws ServletException if an error occurred
 * @throws IOException if an error occurred
 */
public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {

doPost(request response);
}

/**
 * The doPost method of the servlet. 

 *
 * This method is called when a form has its tag value method equals to post.
 * 
 * @param request the request send by the client to the server
 * @param response the response send by the server to the client
 * @throws ServletException if an error occurred
 * @throws IOException if an error occurred
 */
public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {

response.setCharacterEncoding(“utf-8“);
String popedom=request.getParameter(“popedom“);
String title=request.getParameter(“title“);
String content=request.getParameter(“content“);

title = new String(title.getBytes(“ISO8859-1“) “UTF-8“);
db.DbAccess dao=new db.DbAccess(“mydb“);
String sql=“insert into news(popedomtitle) values (“+popedom+“‘“+title+“‘)“;
if(dao.getInt(sql)>0){
System.out.println(“数据插入成功“);
}else{
System.out.println(“数据插入失败....“);
}
// String sqlId=“select nId from news where title=“+title;
// ResultSet rs=dao.getResultSet(sqlId);
// try {
// String id=rs.getString(“nId“);
// } catch (SQLException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
response.sendRedirect(“admin/newsManage.jsp“);
}

}

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

     文件     523111  2011-03-26 16:59  zhaoTutor终极完美版\db.rar

     文件        432  2011-03-15 17:09  zhaoTutor终极完美版\zhaoTutor\.classpath

     文件        300  2011-03-28 09:14  zhaoTutor终极完美版\zhaoTutor\.mymetadata

     文件       1415  2011-03-15 16:43  zhaoTutor终极完美版\zhaoTutor\.project

     文件        500  2011-03-15 16:43  zhaoTutor终极完美版\zhaoTutor\.settings\.jsdtscope

     文件        330  2011-03-15 16:43  zhaoTutor终极完美版\zhaoTutor\.settings\org.eclipse.jdt.core.prefs

     文件         49  2011-03-15 16:43  zhaoTutor终极完美版\zhaoTutor\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2011-03-15 16:43  zhaoTutor终极完美版\zhaoTutor\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件    3145728  2011-03-14 10:56  zhaoTutor终极完美版\zhaoTutor\db\db_tutor.mdf

     文件    1048576  2011-03-14 10:56  zhaoTutor终极完美版\zhaoTutor\db\db_tutor_log.ldf

     文件       2234  2011-03-26 10:08  zhaoTutor终极完美版\zhaoTutor\src\admin\addNews.java

     文件        960  2011-03-25 09:56  zhaoTutor终极完美版\zhaoTutor\src\admin\adminPop.java

     文件       1982  2011-03-25 09:56  zhaoTutor终极完美版\zhaoTutor\src\admin\changeUserPop.java

     文件       1877  2011-03-25 09:56  zhaoTutor终极完美版\zhaoTutor\src\admin\deleteMsg.java

     文件       1744  2011-03-25 09:56  zhaoTutor终极完美版\zhaoTutor\src\admin\deleteNews.java

     文件        639  2011-03-15 16:43  zhaoTutor终极完美版\zhaoTutor\src\beans\New.java

     文件       2706  2011-03-23 18:55  zhaoTutor终极完美版\zhaoTutor\src\beans\Order.java

     文件       1822  2011-03-17 16:11  zhaoTutor终极完美版\zhaoTutor\src\beans\Student.java

     文件       2358  2011-03-17 16:11  zhaoTutor终极完美版\zhaoTutor\src\beans\Teacher.java

     文件       1495  2011-03-19 09:53  zhaoTutor终极完美版\zhaoTutor\src\beans\User.java

     文件       1830  2011-03-26 14:56  zhaoTutor终极完美版\zhaoTutor\src\community\addReadTime.java

     文件       1929  2011-03-25 09:57  zhaoTutor终极完美版\zhaoTutor\src\community\msgBoard.java

     文件       2845  2011-03-17 10:07  zhaoTutor终极完美版\zhaoTutor\src\db\DbAccess.java

     文件       2195  2011-03-25 08:52  zhaoTutor终极完美版\zhaoTutor\src\pub\Ajax.java

     文件       2363  2011-03-26 15:31  zhaoTutor终极完美版\zhaoTutor\src\pub\FindPwd.java

     文件       2768  2011-03-26 15:41  zhaoTutor终极完美版\zhaoTutor\src\pub\FindPwd2.java

     文件       4314  2011-03-26 15:32  zhaoTutor终极完美版\zhaoTutor\src\pub\Info.java

     文件       3721  2011-03-25 09:45  zhaoTutor终极完美版\zhaoTutor\src\pub\InfoStu.java

     文件       2973  2011-03-25 13:19  zhaoTutor终极完美版\zhaoTutor\src\pub\Login.java

     文件       2712  2011-03-25 08:52  zhaoTutor终极完美版\zhaoTutor\src\pub\Message.java

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

评论

共有 条评论