⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index_0002ejsp_jsp.java

📁 基于J2EE的个人数字助理系统,大家参考下,提出宝贵意见
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class index_0002ejsp_jsp extends HttpJspBase {

    // begin [file="/index.jsp";from=(8,3);to=(8,15)]
         boolean a; 
    // end

    static {
    }
    public index_0002ejsp_jsp( ) {
    }

    private static boolean _jspx_inited = false;

    public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
    }

    public void _jspService(HttpServletRequest request, HttpServletResponse  response)
        throws java.io.IOException, ServletException {

        JspFactory _jspxFactory = null;
        PageContext pageContext = null;
        HttpSession session = null;
        ServletContext application = null;
        ServletConfig config = null;
        JspWriter out = null;
        Object page = this;
        String  _value = null;
        try {

            if (_jspx_inited == false) {
                synchronized (this) {
                    if (_jspx_inited == false) {
                        _jspx_init();
                        _jspx_inited = true;
                    }
                }
            }
            _jspxFactory = JspFactory.getDefaultFactory();
            response.setContentType("text/html; charset=GBK");
            pageContext = _jspxFactory.getPageContext(this, request, response,
            			"", true, 8192, true);

            application = pageContext.getServletContext();
            config = pageContext.getServletConfig();
            session = pageContext.getSession();
            out = pageContext.getOut();

            // HTML // begin [file="/index.jsp";from=(0,0);to=(6,0)]
                out.write("<SCRIPT language=\"javascript\">\r\nfunction backward()\r\n{\r\n      history.back();\r\n}\r\n</SCRIPT>\r\n");

            // end
            // HTML // begin [file="/index.jsp";from=(6,48);to=(7,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/index.jsp";from=(7,30);to=(8,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/index.jsp";from=(8,17);to=(9,0)]
                out.write("\r\n");

            // end
            // begin [file="/index.jsp";from=(9,2);to=(36,0)]
                
                	//第一步:获取login.htm页面表单体叫过来的元素值
                  	String struid, strpsw;
                        struid = request.getParameter("username");
                  	strpsw = request.getParameter("pasw");
                       //第二步:加载驱动
                        try{
                		Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                	        }catch(ClassNotFoundException e){
                		       System.out.println(e.getMessage());
                	}
                        //第三步:架桥,并执行SQL
                  String sql = "select * from custom where uid='"+struid+"' and psw='"+strpsw+"'";
                	try{
                                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                		Connection cnCon = DriverManager.getConnection("jdbc:odbc:shm"," "," ");
                		Statement stmt = cnCon.createStatement();
                		ResultSet rs = stmt.executeQuery(sql);
                		a=rs.next();
                              }catch(SQLException e){
                		System.out.println(e.getMessage());
                	}
                   if(a==true)
                  {
                //用户id及密码输入正确的情况
                session.setAttribute("struid",struid);
                
            // end
            // HTML // begin [file="/index.jsp";from=(36,2);to=(65,0)]
                out.write("\r\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n\"http://www.w3.org/TR/html4/loose.dtd\">\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<style type=\"text/css\">\r\n<!--\r\n.style2 {font-size: large}\r\n.style3 {\r\n\tfont-family: \"华文行楷\";\r\n\tfont-size: 18px;\r\n        color: #FF6600;}\r\na:link { text-decoration: none;color: #FF6600}\r\n   a:active { text-decoration:blink}\r\n   a:hover { text-decoration:underline;color: red}\r\n   a:visited { text-decoration: none;color: green}\r\n.style11 {font-family: \"华文行楷\"}\r\n.style22 {color: #FF0000}\r\nbody {\r\n\tbackground-color: #99CCFF;\r\n}\r\n-->\r\n</style>\r\n<title>主页面</title>\r\n</head>\r\n<body  onload=\"clock()\">\r\n<div id=\"Layer1\" style=\"position:absolute; left:212px; top:115px; width:26px; height:500px; z-index:1\"><img src=\"image/index/bg_line2.gif\" width=\"3\" height=\"500\"></div>\r\n<div id=\"Layer2\" style=\"position:absolute; left:250px; top:114px; width:619px; height:500px; z-index:2\">\r\n");

            // end
            // begin [file="/index.jsp";from=(65,2);to=(84,0)]
                
                       String a1="",b1="",c1="",d1="",e1="",f1="",g1="",h1="",z1="",j1="";
                       try{
                                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                		Connection cnCon = DriverManager.getConnection("jdbc:odbc:shm"," "," ");
                		Statement stmt = cnCon.createStatement();
                		ResultSet rs = stmt.executeQuery("select * from custom where uid='"+struid+"' and psw='"+strpsw+"'");
                		while(rs.next()){
                		int i=1;
                	a1=rs.getString(i++);
                	b1=rs.getString(i++);
                	c1=rs.getString(i++);
                	d1=rs.getString(i++);
                	e1=rs.getString(i++);
                	f1=rs.getString(i++);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -