• 大小: 4.64MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-07
  • 语言: Java
  • 标签:

资源简介

jsp+mysql在线考试系统+文档

资源截图

代码片段和文件信息

package jinghua;

/**
 * 

title: Jinghua-TestOnline


 * 

Description: 


 * 

Copyright: Copyright (c) 2003


 * 

Company: Bit


 * @author ChengBaodong
 * @version 1.0
 */

import java.sql.*;

//sqlConn=java.sql.DriverManager.getConnection(
//“jdbc:mysql://localhost/train?user=support&password=support&useUnicode=true&characterEncoding=gb2312“);
//String MM_con1_DRIVER = “com.mysql.jdbc.Driver“;
//String MM_con1_USERNAME = “root“;
//String MM_con1_PASSWORD = ““;
//String MM_con1_STRING = “jdbc:mysql://localhost/jinghua“;
//Driver DriverRecordset1 = (Driver)Class.forName(MM_con1_DRIVER).newInstance();
//Connection Con = java.sql.DriverManager.getConnection(MM_con1_STRINGMM_con1_USERNAMEMM_con1_PASSWORD);

public class JinghuaConn {
    private static String rootpath=“D:\\JavaApp\\Jinghua\\test_online“;
    private static String chartPath=“D:\\JavaApp\\Jinghua\\test_online\\chart\\temp“;
//    private static String rootpath=“/sfroot/home/groups/jsptestonline“;
//    private static String chartPath=“/sfroot/home/groups/jsptestonline/chart/temp“;
    private String sample = “Sample“;
    private Connection con = null;
    private Statement stmt = null;
    ResultSet rs = null;
    private static final String DRIVER = “com.mysql.jdbc.Driver“;
    private static final String USERNAME = “root“;
    private static final String PASSWORD = ““;
   private static final String HOST = “http://localhost:8080“;

//    private static final String HOST = “http://jsptestonline.cosoft.org.cn“;
    private static final String PHYPATH = “D:/JavaApp/Jinghua/test_online“;
//    private static final String PHYPATH = “/sfroot/home/groups/jsptestonline“;
    private static final String CONNECTION_STRING =
        “jdbc:mysql://localhost/jinghua“;
    public static String getRootPath(){
        return rootpath;
    }
    public static String getChartPath(){
        return chartPath;
    }

    public JinghuaConn() {
        try {
            Driver DriverJinghua = (Driver) Class.forName(DRIVER).newInstance();
            //Con = DriverManager.getConnection(CONNECTION_STRINGUSERNAMEPASSWORD);
        }
        catch (ClassNotFoundException e) {
            System.err.println(“JinghuaConn():“ + e.toString());
        }
        catch (Exception e) {
            System.err.println(“JinghuaConn():“ + e.toString());
        }

    }

    public Connection getConnection() {
        try {

            //Con = DriverManager.getConnection(CONNECTION_STRINGUSERNAMEPASSWORD);
            String strUrl = CONNECTION_STRING + “?user=“ + USERNAME +
                “&password=“ +
                PASSWORD + “&useUnicode=true&characterEncoding=gb2312“;
            con = DriverManager.getConnection(strUrl);

        }

        catch (Exception e) {
            con = null;
        }

        return con;
    }

    public void dropConnection() {
        try {
            closeStmt();
        

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

     文件          0  2004-05-13 16:36  Doc目录下有几个文档.txt

     目录          0  2004-05-13 22:43  chart

     文件        313  2003-10-31 23:16  chart\abandon_session.jsp

     目录          0  2004-04-22 09:02  chart\common

     文件        655  2003-05-09 12:34  chart\common\input.htc

     文件        171  2003-02-24 15:32  chart\common\popwin.js

     文件       1758  2003-05-14 17:17  chart\common\style.css

     目录          0  2004-04-22 09:02  chart\iframe

     文件        750  2004-04-21 22:48  chart\iframe\bot.htm

     文件        753  2004-04-21 22:48  chart\iframe\head.htm

     文件       4977  2004-04-21 22:45  chart\iframe\left.jsp

     目录          0  2004-04-22 09:02  chart\images

     文件         97  2003-04-17 17:05  chart\images\0cir.gif

     文件         98  2003-04-17 17:05  chart\images\0cir_bl.gif

     文件         98  2003-04-17 17:05  chart\images\0cir_br.gif

     文件         97  2003-04-17 17:05  chart\images\0cir_r.gif

     文件         43  2002-11-19 09:03  chart\images\1px.gif

     文件         83  2003-05-08 14:47  chart\images\bg_bot.gif

     文件        111  2003-05-08 14:46  chart\images\bg_head.gif

     文件         46  2003-03-01 19:09  chart\images\bg_line.gif

     文件      35729  2003-05-08 15:18  chart\images\bg_login_r.gif

     文件       8228  2003-05-08 15:22  chart\images\bot_pic_login.gif

     文件        993  2003-01-28 13:14  chart\images\button_refresh.png

     文件         64  2003-05-05 10:37  chart\images\djt.gif

     文件         48  2003-04-21 11:06  chart\images\dot.gif

     文件         75  2003-05-05 10:37  chart\images\fk.gif

     文件      45998  2003-05-08 15:21  chart\images\head_pic.gif

     文件        667  2003-10-30 15:39  chart\images\head_pic1.jpg

     文件       1312  2003-05-08 18:13  chart\images\icon_bgxz.gif

     文件       1121  2003-05-08 17:41  chart\images\icon_bszn.gif

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

评论

共有 条评论