• 大小: 144KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-09
  • 语言: Java
  • 标签: mvc  java  mysql  源码  

资源简介

一个java基于mvc开发的电影网站 有源码

资源截图

代码片段和文件信息


package com.wsf.Web;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;

/**
 *
 * @author Administrator
 */
public class DatabaseBean {
    static private String DBDriver = “com.mysql.jdbc.Driver“;
    static private String url=“jdbc:mysql://localhost:3306/movie?useUnicode=true&characterEncoding=gb2312“;
    private static Connection con=null;
    
    
    
    /** Creates a new instance of DBConnection */
    public DatabaseBean() {
        
    }
    public static void connect(){
        
        
        try {
            Class.forName(DBDriver);
        } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
        }
        
        try {
            con=DriverManager.getConnection(url“root““123“);
            
        } catch(SQLException e2) {
        }
    }
    public static String selectMapping(String sql){
        Statement stmt = null;
        ResultSet rs = null;
        String chinese = null;
        connect();
        try {
            stmt=con.createStatement();
            rs=stmt.executeQuery(sql);
            while(rs.next()){
             
          chinese=rs.getString(“chinese“);
            }
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
         finally{
            close(constmtrs);
        }
       return chinese;
      
    }
    public static void updateMovie(String sql){
        Statement stmt = null;
         ResultSet rs = null;
        connect();
        try {
            stmt=con.createStatement();
            stmt.executeUpdate(sql);
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
      
    }
    public static String selectFile(String sql){
        String filepath = null;
         ResultSet rs = null;
        Statement stmt = null;
       connect();
        try {
            stmt=con.createStatement();
             rs=stmt.executeQuery(sql);
     while(rs.next()){
             filepath= rs.getString(“filepath“);
                
        }
        } catch (SQLException ex) {
            ex.printStackTrace();
        }   
       finally{
            close(constmtrs);
        }
       return filepath;
     }
    
    
    public static Vector selectMovie(String sql){
       Vector vector=new Vector();
        ResultSet rs = null;
        Statement stmt = null;
         connect();
        try {
            stmt=con.createStatement();
            rs=stmt.executeQuery(sql);
            while(rs.next()){
                 MovieBean mb=new MovieBean();
                 mb.setId(rs.getInt(1));
                 mb.setName(rs.getString(2));
                 mb.setActor(rs.getString(3));
                 mb.setDirector(rs.getString(4));
                 mb.setArea(rs.getStri

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

     文件       7575  2008-06-09 21:43  film\build\web\css\style.css

     文件         66  2008-06-09 21:43  film\build\web\images\bottombg.gif

     文件        334  2008-06-09 21:43  film\build\web\images\Forum_readme.gif

     文件       5490  2008-06-09 21:43  film\build\web\images\logo.gif

     文件      23668  2008-06-09 21:43  film\build\web\images\top.jpg

     文件         66  2008-06-09 21:43  film\build\web\images\topbg.gif

     文件        157  2008-06-09 21:43  film\build\web\index.jsp

     文件        395  2008-06-09 21:43  film\build\web\js\multiFunction.js

     文件       1122  2008-06-09 21:43  film\build\web\js\showHideDiv.js

     文件       1628  2008-06-09 21:43  film\build\web\js\showTime.js

     文件      14034  2008-06-09 21:43  film\build\web\main.jsp

     文件         64  2008-06-09 21:43  film\build\web\meta-INF\context.xml

     文件         23  2008-06-09 21:43  film\build\web\meta-INF\MANIFEST.MF

     文件      14203  2008-06-09 21:43  film\build\web\type.jsp

     文件      10040  2008-06-09 21:43  film\build\web\view.jsp

     文件       3854  2008-06-09 21:43  film\build\web\WEB-INF\classes\com\wsf\Web\DatabaseBean.class

     文件       3416  2008-06-09 21:43  film\build\web\WEB-INF\classes\com\wsf\Web\downServlet.class

     文件       3908  2008-06-09 21:43  film\build\web\WEB-INF\classes\com\wsf\Web\MainServlet.class

     文件       2257  2008-06-09 21:43  film\build\web\WEB-INF\classes\com\wsf\Web\MovieBean.class

     文件       2169  2008-06-09 21:43  film\build\web\WEB-INF\classes\com\wsf\Web\searchServlet.class

     文件       1337  2008-06-09 21:43  film\build\web\WEB-INF\web.xml

     文件       3011  2008-04-09 20:10  film\build.xml

     文件      99361  2008-06-09 21:43  film\dist\film.war

     文件      31696  2008-04-09 20:10  film\nbproject\build-impl.xml

     文件        455  2008-04-09 20:10  film\nbproject\genfiles.properties

     文件       1075  2008-04-09 20:10  film\nbproject\private\private.properties

     文件        211  2008-04-21 19:52  film\nbproject\private\private.xml

     文件       2030  2008-04-09 20:10  film\nbproject\project.properties

     文件        695  2008-04-09 20:10  film\nbproject\project.xml

     文件         23  2008-03-22 13:57  film\src\conf\MANIFEST.MF

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

评论

共有 条评论