📄 my_0002ejsp_jsp.java
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class my_0002ejsp_jsp extends HttpJspBase {
// begin [file="/my.jsp";from=(9,0);to=(9,64)]
// end
static {
}
public my_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=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// HTML // begin [file="/my.jsp";from=(0,47);to=(1,0)]
out.write("\r\n");
// end
// HTML // begin [file="/my.jsp";from=(1,51);to=(9,0)]
out.write("\r\n\r\n<html>\r\n<head>\r\n <title>JSP连接mysql!</title>\r\n </head>\r\n <body>\r\n \r\n");
// end
// begin [file="/my.jsp";from=(9,0);to=(9,64)]
com.forcg.Dbco DBconn1 = null;
boolean _jspx_specialDBconn1 = false;
synchronized (pageContext) {
DBconn1= (com.forcg.Dbco)
pageContext.getAttribute("DBconn1",PageContext.PAGE_SCOPE);
if ( DBconn1 == null ) {
_jspx_specialDBconn1 = true;
try {
DBconn1 = (com.forcg.Dbco) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.forcg.Dbco");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException (" Cannot create bean of class "+"com.forcg.Dbco", exc);
}
pageContext.setAttribute("DBconn1", DBconn1, PageContext.PAGE_SCOPE);
}
}
if(_jspx_specialDBconn1 == true) {
// end
// begin [file="/my.jsp";from=(9,0);to=(9,64)]
}
// end
// HTML // begin [file="/my.jsp";from=(9,64);to=(10,0)]
out.write("\r\n");
// end
// begin [file="/my.jsp";from=(10,2);to=(18,1)]
String thename;
thename=request.getParameter("thename");
String username;
ResultSet RS = DBconn1.executeQuery
("SELECT * FROM admin");
while (RS.next()) {
username=RS.getString("username");
// end
// HTML // begin [file="/my.jsp";from=(18,3);to=(19,1)]
out.write("\r\n\t");
// end
// begin [file="/my.jsp";from=(19,3);to=(20,33)]
if (thename.equals(username)){
// end
// HTML // begin [file="/my.jsp";from=(20,35);to=(22,5)]
out.write("\r\n <table><tr><td>succeed</td></tr></table>\r\n ");
// end
// begin [file="/my.jsp";from=(22,7);to=(26,0)]
}
}
RS.close();
//out.println(thename);
// end
// HTML // begin [file="/my.jsp";from=(26,2);to=(30,0)]
out.write("\r\n\r\n </body>\r\n</html>\r\n");
// end
} catch (Throwable t) {
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -