资源简介
启程家教网站 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\.myme
文件 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个文件信息
相关资源
- javax.faces-2.2.0.jar
- leetcode简单+中等题目参考答案java版
- 基于JAVA的七巧板游戏设计与实现
- 进销存管理系统(jsp+servlet+mssql)
- 博客系统网站JSP+SERVLET+MYSQL
- ACCP8.0所有课件以及源码
- 电子相册jsp+servlet+javabean+ajax+sqlserve
- JSP基于WEB的考务管理系统的设计与实
- 2019JAVA BAT 面试宝典 springboot springm
- 数据结构与算法Java 描述 - 邓俊辉 -
- 用java写的日记管理系统
- servlet+jsp+javabean+mysql做的简单新闻发布
- 完整的JSP网站书店项目源码
- Jsp+Servlet+Echarts实现动态数据可视化
- 学生管理系统 web
- jsp 网上投票系统
- Java毕业设计-图书管理系统
- estore商城网站
- JSP个人博客系统完整版
- LeetCode前400题Java精美版
- 基于java web的汽车租赁管理系统
- 北邮信息网络应用JSP网页实验报告
- 基于SSH框架网上书店JavaEE大作业实验
- 自动机绘制工具以及使用手册(JFLA
- Bhu校园二手交易市场
- 宠物医院管理系统的源代码
- java 分页功能参考代码
- 基于JavaWeb的博客网站的设计与实现答
- TheJavaProgrammingLanguage4thEdition.pdf
- websphere javacore 分析工具 jca412
评论
共有 条评论