资源简介
简单的留言板程序,可以学习,也可以当作一次实验报告。用户名密码都是root

代码片段和文件信息
/* */ package dao;
/* */ import java.sql.PreparedStatement;
/* */ import java.sql.ResultSet;
/* */ import java.util.ArrayList;
import java.util.List;
import dbc.DatabaseConnection;
import model.Note;
/* */
/* */ public class NoteDAO{
/* */ public void insert(Note note)throws Exception{
/* 11 */ String sql = “INSERT INTO note1(titleauthorcontent) VALUES(???)“;
/* 12 */ PreparedStatement pstmt = null;
/* 13 */ DatabaseConnection dbc = null;
/* 14 */ dbc = new DatabaseConnection();
/* */ try
/* */ {
/* 17 */ pstmt = dbc.getConnection().prepareStatement(sql);
/* 18 */ pstmt.setString(1 note.gettitle());
/* 19 */ pstmt.setString(2 note.getAuthor());
/* 20 */ pstmt.setString(3 note.getContent());
/* 21 */ pstmt.executeUpdate();
/* 22 */ pstmt.close();
/* */ }
/* */ catch (Exception e)
/* */ {
/* 27 */ throw new Exception(“操作中出现错误!!!“);
/* */ }
/* */ finally
/* */ {
/* 31 */ dbc.close();
/* */ }
/* */ }
/* */
/* */ public void update(Note note) throws Exception
/* */ {
/* 37 */ String sql = “UPDATE note1 SET title=?author=?content=? WHERE id=?“;
/* 38 */ PreparedStatement pstmt = null;
/* 39 */ DatabaseConnection dbc = null;
/* 40 */ dbc = new DatabaseConnection();
/* */ try
/* */ {
/* 43 */ pstmt = dbc.getConnection().prepareStatement(sql);
/* 44 */ pstmt.setString(1 note.gettitle());
/* 45 */ pstmt.setString(2 note.getAuthor());
/* 46 */ pstmt.setString(3 note.getContent());
/* 47 */ pstmt.setInt(4 note.getId());
/* 48 */ pstmt.executeUpdate();
/* 49 */ pstmt.close();
/* */ }
/* */ catch (Exception e){
/* 53 */ throw new Exception(“操作中出现错误!!!“);
/* */ }finally{
/* 57 */ dbc.close();
/* */ }
/* */ }
/* */
/* */ public void delete(int id) throws Exception
/* */ {
/* 63 */ String sql = “DELETE FROM note1 WHERE id=?“;
/* 64 */ PreparedStatement pstmt = null;
/* 65 */ DatabaseConnection dbc = new DatabaseConnection();
/* */ try
/* */ {
/* 69 */ pstmt = dbc.getConnection().prepareStatement(sql);
/* 70 */ pstmt.setInt(1 id);
/* 71 */ pstmt.executeUpdate();
/* 72 */ pstmt.close();
/* */ }
/* */ catch (Exception e){
/* 76 */ throw new Exception(“操作中出现错误!!!“);
/* */ }
/* */ finally{
/* 80 */ dbc.close();
/* */ }
/* */ }
/* */
/* */ public Note queryById(int id) throws Exception
/* */ {
/* 86 */ Note note = null;
/* 87 */ String sql = “SELECT idtitleauthorcontent FROM note1 WHERE id=?“;
/* 88 */ PreparedStatement pstmt = null;
/* 89 */ DatabaseConnection dbc = nul
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-11-26 15:54 Note\
文件 455 2017-10-18 18:31 Note\.classpath
目录 0 2018-01-08 15:24 Note\.myeclipse\
文件 285 2018-01-07 15:44 Note\.myme
文件 1410 2017-10-18 18:37 Note\.project
目录 0 2017-11-26 15:54 Note\.settings\
文件 500 2017-10-18 18:30 Note\.settings\.jsdtscope
文件 49 2017-10-18 18:30 Note\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-10-18 18:30 Note\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2017-11-26 15:54 Note\WebRoot\
目录 0 2017-11-26 15:54 Note\WebRoot\me
文件 36 2017-10-18 18:30 Note\WebRoot\me
目录 0 2017-11-26 15:54 Note\WebRoot\WEB-INF\
目录 0 2018-01-07 22:49 Note\WebRoot\WEB-INF\classes\
目录 0 2018-01-07 22:49 Note\WebRoot\WEB-INF\classes\dao\
文件 4826 2018-01-07 22:49 Note\WebRoot\WEB-INF\classes\dao\NoteDAO.class
文件 1682 2018-01-07 22:49 Note\WebRoot\WEB-INF\classes\dao\PersonDAO.class
目录 0 2018-01-07 22:49 Note\WebRoot\WEB-INF\classes\dbc\
文件 1107 2018-01-07 22:49 Note\WebRoot\WEB-INF\classes\dbc\Databa
目录 0 2018-01-07 22:49 Note\WebRoot\WEB-INF\classes\model\
文件 1074 2018-01-07 22:49 Note\WebRoot\WEB-INF\classes\model\Note.class
文件 875 2018-01-07 22:49 Note\WebRoot\WEB-INF\classes\model\Person.class
目录 0 2018-01-07 22:49 Note\WebRoot\WEB-INF\classes\servlet\
文件 2040 2018-01-07 22:49 Note\WebRoot\WEB-INF\classes\servlet\LoginServlet.class
文件 3467 2018-01-07 22:49 Note\WebRoot\WEB-INF\classes\servlet\NoteServlet.class
目录 0 2017-11-26 15:54 Note\WebRoot\WEB-INF\lib\
文件 703265 2017-10-18 18:31 Note\WebRoot\WEB-INF\lib\mysql-connector-java-5.1.6-bin.jar
文件 756 2017-10-18 18:32 Note\WebRoot\WEB-INF\web.xm
文件 1022 2017-10-18 18:31 Note\WebRoot\delete_do.jsp
文件 748 2017-10-18 18:31 Note\WebRoot\errors.jsp
文件 1233 2018-01-07 23:22 Note\WebRoot\index.jsp
............此处省略20个文件信息
相关资源
- JavaEE图书管理系统95427
- JSP留言板8745
- 2018年传智播客黑马训练营JAVAEE49期培
- 韩顺平Java和javaEE视频教程资 资源 完
- 《Java EE企业级应用开发教程Spring+Sp
- android 留言板小demo
- jsp00357房屋中介管理系统ssh+myeclipse+
- 《轻量级JavaEE企业应用实战》配套资
- myeclipse开发servlet+jsp+oracle+c3p0的java
- 轻量级JavaEE企业应用实战第5版 光盘
- 轻量级Java EE企业应用实战第4版光盘
- Java课程设计超市管理系统Myeclipse+My
- 《JavaEE架构设计与开发实践》课本源
- myEclipse实现购物车
- JAVA EE网上考试系统
- 使用javaee实现的网上书店包含数据库
- javaee学生管理系统,教务管理系统,
- jsp留言板包括留言添加,修改,删除
- java图书管理系统,一个javaee项目
- javaEE框架实现宿舍管理系统
- javaEE登录注册
- MyEclipse-MySQL jsp新闻发布系统
- 图书馆信息管理系统利用框架开发利
- MyEclipse汉化破解
- jsp网上在线购物系统采用MVC模式 环境
- myeclipse 网上购物系统
- javaEE上传文件和参数
- javaEE上传文件
- javaEE开发 api中英文对照版
- javaEE+jsp+MySql学生成绩管理系统(ecl
评论
共有 条评论