• 大小: 116KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-10
  • 语言: Java
  • 标签: jsp+access  

资源简介

本系统采用jsp+access,完成了新闻发布系统,系统只需要对数据源进行配置,方便好用!

资源截图

代码片段和文件信息

package edu.cec.bean;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;


public class DBbean {
private Connection cn;
private Statement st;

public Connection getConnection()

String url=“jdbc:mysql://localhost:3306/db_news“;
String usename=“root“;
String password=“121121“;
 if(cn==null)
 {
try {
Class.forName(“com.mysql.jdbc.Driver“);
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
cn=DriverManager.getConnection(urlusenamepassword);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
return cn;
}
public ResultSet executeQuery(String sql)
{
if(cn==null)
{
cn=getConnection();
}

 try {
st=cn.createStatement();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

try {
return st.executeQuery(sql);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}

}
public int executeUpdate(String sql)
{
if(cn==null)
{
cn=getConnection();

}
try{
st= cn.createStatement();}
catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
return st.executeUpdate(sql);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return 0 ;
}

}
public void close()
{
if(cn!=null)
{
try {
st.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
cn.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
if(cn.isClosed()==false)
{
cn.close();
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}

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

     文件        479  2009-12-02 15:11  news\.classpath

     文件       1037  2009-12-02 15:11  news\.project

     文件        360  2009-12-02 15:11  news\.settings\.jsdtscope

     文件        330  2009-12-02 15:11  news\.settings\org.eclipse.jdt.core.prefs

     文件        217  2009-12-02 15:11  news\.settings\org.eclipse.jst.common.project.facet.core.prefs

     文件        414  2009-12-02 15:11  news\.settings\org.eclipse.wst.common.component

     文件        229  2009-12-02 15:11  news\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2009-12-02 15:11  news\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2009-12-02 15:11  news\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       2146  2009-12-29 14:23  news\build\classes\edu\cec\bean\DBbean.class

     文件       6310  2009-12-29 14:23  news\build\classes\edu\cec\bean\Manager.class

     文件       9189  2010-01-28 09:43  news\build\classes\edu\cec\bean\newsBean.class

     文件       3562  2009-12-29 14:23  news\build\classes\edu\cec\bean\newstypeBean.class

     文件       2763  2009-12-29 14:23  news\build\classes\edu\cec\serv\Addmanager.class

     文件       2360  2009-12-29 14:23  news\build\classes\edu\cec\serv\AddnewsServlet.class

     文件       2383  2009-12-29 14:23  news\build\classes\edu\cec\serv\AddnewstypeServlet.class

     文件       2550  2009-12-29 14:23  news\build\classes\edu\cec\serv\cupdateManagerServlet.class

     文件       2265  2009-12-29 14:23  news\build\classes\edu\cec\serv\cupdateNewsServlet.class

     文件       2101  2009-12-29 14:23  news\build\classes\edu\cec\serv\cupdatenewstypeServlet.class

     文件       1964  2009-12-29 14:23  news\build\classes\edu\cec\serv\deleteManagerservlet.class

     文件       2026  2009-12-29 14:23  news\build\classes\edu\cec\serv\deleteNewsServlet.class

     文件       2052  2009-12-29 14:23  news\build\classes\edu\cec\serv\deletenewstypeServlet.class

     文件       1722  2009-12-29 14:23  news\build\classes\edu\cec\serv\FindAllManagerServlet.class

     文件       1783  2009-12-29 14:23  news\build\classes\edu\cec\serv\FindAllNewsServlet.class

     文件       1728  2009-12-29 14:23  news\build\classes\edu\cec\serv\FindllnewstypeServlet.class

     文件       2294  2009-12-29 14:23  news\build\classes\edu\cec\serv\GuanliyuanLogin.class

     文件       1948  2010-01-28 09:44  news\build\classes\edu\cec\serv\NewsContentServlet.class

     文件       1693  2009-12-29 14:23  news\build\classes\edu\cec\serv\SousuoServlet.class

     文件       2154  2009-12-29 14:23  news\build\classes\edu\cec\serv\ThekindnewsServlet.class

     文件       1739  2009-12-29 14:23  news\build\classes\edu\cec\serv\updateManagerServlet.class

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

评论

共有 条评论