• 大小: 2.4MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-13
  • 语言: Java
  • 标签: JSP+SQL  招聘网站  

资源简介

JSP+SQL 人才招聘网站代码

资源截图

代码片段和文件信息

package com.bwm.db;

import java.sql.*;

/**
 *class explain:Database connection
 *set up name: crazyadept
 *set up time: 11/22/2004
 */
public class Conn {
    private static Connection con;
    private Statement stmt;
    private ResultSet rs;
    private static final String drivername =
        “com.microsoft.jdbc.sqlserver.SQLServerDriver“;
    private static final String url = “jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=db_Job;user=sa;password=;“;

    /**
     *method explain:   Get Connection Database
     *modify time: 12/20/2004
     */
    public static synchronized Connection getCon() throws Exception {
        try {
            Class.forName(drivername);
            con = DriverManager.getConnection(url);
            return con;
        } catch (SQLException e) {
            System.err.println(e.getMessage());
            throw e;
        }
    }

    /**
     *output parameter: in order select in SQL
     *modify time: 12/20/2004
     */
    public Statement getStmtread() {
        try {
            con = getCon();
            stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE
                                       ResultSet.CONCUR_READ_ONLY);
            return stmt;
        } catch (Exception e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
        }
        return null;
    }

    /**
     *output parameter: Data
     *input parameter:  SQL select sentence
     *modify time:      11/29/2004
     */
    public ResultSet getRs(String sql) {
        try {
            stmt = getStmtread();
            rs = stmt.executeQuery(sql);
            return rs;
        } catch (Exception e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
        }
        return null;
    }

    /**
     *output parameter: not in order select in str SQL
     *modify time:      11/29/2004
     */
    public Statement getStmt() {
        try {
            con = getCon();
            stmt = con.createStatement();
            return stmt;
        } catch (Exception e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
        }
        return null;
    }

    /**
     *method explain:   Close Database Connection
     *modify time:      11/29/2004
     */
    public synchronized void close() {
        try {
            if (rs != null) {
                rs.close();
                rs = null;
            }
        } catch (Exception e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
        }
        try {
            if (stmt != null) {
                stmt.close();
                stmt = null;
            }
        } catch (Exception e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
        }
        try {
            if (con != null) {
                con.close();

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-12-02 10:58  JSP+SQL\
     目录           0  2012-12-02 10:58  JSP+SQL\xlb\
     目录           0  2012-12-02 10:58  JSP+SQL\xlb\admin\
     文件         674  2010-04-17 20:17  JSP+SQL\xlb\admin\admin.jsp
     文件        1867  2010-04-17 20:17  JSP+SQL\xlb\admin\aflink.jsp
     文件        1890  2010-04-17 20:17  JSP+SQL\xlb\admin\cjob.jsp
     文件        1782  2010-04-17 20:17  JSP+SQL\xlb\admin\company.jsp
     文件         448  2010-04-17 20:17  JSP+SQL\xlb\admin\dcjob.jsp
     文件         451  2010-04-17 20:17  JSP+SQL\xlb\admin\dcompany.jsp
     文件         443  2010-04-17 20:17  JSP+SQL\xlb\admin\dflink.jsp
     文件         448  2010-04-17 20:17  JSP+SQL\xlb\admin\dsjob.jsp
     文件         451  2010-04-17 20:17  JSP+SQL\xlb\admin\dstudent.jsp
     文件        2059  2010-04-17 20:17  JSP+SQL\xlb\admin\flink.jsp
     文件         162  2010-04-17 20:18  JSP+SQL\xlb\admin\include.jsp
     文件        1222  2010-04-17 20:18  JSP+SQL\xlb\admin\index.htm
     文件         557  2010-04-17 20:18  JSP+SQL\xlb\admin\login.htm
     文件         809  2010-04-17 20:18  JSP+SQL\xlb\admin\login.jsp
     文件         771  2010-04-17 20:18  JSP+SQL\xlb\admin\mflink.jsp
     文件        1764  2010-04-17 20:18  JSP+SQL\xlb\admin\sjob.jsp
     文件        2028  2010-04-17 20:18  JSP+SQL\xlb\admin\student.jsp
     文件        1076  2010-04-17 20:18  JSP+SQL\xlb\admin\top.htm
     目录           0  2012-12-02 10:58  JSP+SQL\xlb\company\
     文件        1825  2010-05-14 20:21  JSP+SQL\xlb\company\ajobinfo.htm
     文件         907  2010-05-14 20:21  JSP+SQL\xlb\company\ajobinfo.jsp
     文件         737  2010-05-14 20:21  JSP+SQL\xlb\company\djobinfo.jsp
     文件        2555  2010-05-14 20:21  JSP+SQL\xlb\company\index.htm
     文件        1726  2010-05-14 20:21  JSP+SQL\xlb\company\left.htm
     文件         617  2010-05-14 20:21  JSP+SQL\xlb\company\login.htm
     文件         820  2010-05-14 20:22  JSP+SQL\xlb\company\login.jsp
     文件        1581  2010-05-14 20:22  JSP+SQL\xlb\company\mreginfo.jsp
     文件        2165  2010-05-14 20:22  JSP+SQL\xlb\company\reg.jsp
............此处省略111个文件信息

评论

共有 条评论