扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
在本页阅读全文(共19页)
public String validateUser(String inputUserid, String inputPwd) throws SQLException { String returnString = null; String dbUserid = "userid"; // 数据库的用户名 String dbPassword = "password" ; //数据库的密码 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:myDriver", dbUserid , dbPassword ); Statement stmt = con.createStatement(); String sql= "select USERID from USERTABLE where USERID = '" + inputUserid + "' and PASSWORD = '" + inputPwd +"' ;" ; ResultSet rs = stmt.executeQuery(sql); if (rs.next()) { returnString = rs.getString("USERID"); } stmt.close(); con.close(); return returnString ; } |
servletContext application=getServletContext(); |
<% Integer count = null; synchronized (application) { count = (Integer) application.getAttribute("change"); if (count == null) count = new Integer(0); count = new Integer(count.intValue() + 1); application.setAttribute("change", count); } private void printApplication(PrintWriter pw, HttpServletRequest req) throws IOException { ServletContext application = getServletContext(); pw.println(" Application Information:");pw.println("
pw.println(" Application Variables:");pw.println("
} %> Welcome, visitor: <%= count %> |
<% response.setHeader("Pragma","No-cache"); response.setHeader("Cache-Control","no-cache"); response.setDateHeader("Expires", 0); %> |
public static String asHTML(String text) { if (text == null) return ""; StringBuffer results = null; char[] orig = null; int beg = 0, len = text.length(); for (int i = 0; i < len; ++i) { char c = text.charAt(i); switch (c){ case 0: case '&': case '<': case '>': case '"': if (results == null) { orig = text.toCharArray(); results = new StringBuffer(len+10); } if (i > beg) results.append(orig, beg, i-beg); beg = i + 1; switch (c) { default: // case 0: continue; case '&': results.append("&"); break; case '<': results.append("<"); break; case '>': results.append(">"); break; case '"': results.append("""); break; } break; } } if (results == null) return text; results.append(orig, beg, len-beg); return results.toString(); } |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者